Log in

View Full Version : New Memory Leak Thread for 1.5



Red Harvest
12-16-2005, 07:23
Well, the memory leak is back. Had the *exact* same symptoms after a long session. The good news is that it seems to take longer before the leak becomes problematic. Any one else seen it yet? Looks like CA found *a* problem and fixed it, but didn't find all the problems.

I noticed it after coming back to a session after dinner. It was mild at first, but got progressively worse. Was sucking up over 270 MB when I got out. Same routine as before.

Jambo
12-16-2005, 10:13
I guess not, but then I have 1.5 GB RAM so I suppose I'm unlikely to notice any memory problems?

Just A Girl
12-16-2005, 10:35
I guess not, but then I have 1.5 GB RAM so I suppose I'm unlikely to notice any memory problems?


Last time it seemed to affect people with 512mb of ram the most,
so i supose it would take 3x as long for you to relize if it really was a memory leak,
however most "if not all" with more than 512mb of ram never sufferd.
so it cant be a real memory leak or every 1 would notice after a given time period,

I.e
it Takes 120 mins to leak 256mb of ram After that system needs more ram so leeks at a faster rate,
so logic dictates that after 240 mins Of a real memory leak 1gb of ram would have been leaked,
And 360 mins would = 2.5gb + And could result in a system crash
This never happend,

A EXE leaking memory Has no real idea of your amount of ram, So it would not single out 512mb Systems.
So take from that what you will.

Tyrac
12-16-2005, 15:31
It is odd. I have only 768 ram yet have never had this happen that I can tell and I often run the game all day and well into the night playing and leaving and coming back etc. <shrug>

Mouzafphaerre
12-16-2005, 15:40
.
768 > 512 :san_wink:
.

Puzz3D
12-16-2005, 15:44
I have a 512 MB system, and I would get severe slowdowns in RTW v1.3 after playing for a couple of hours. I don't get those slowdowns under RTW v1.5. With RTW v1.5, the RomeTW.exe uses about 250 MB of physical RAM and about 300 MB of virtual RAM. This leaves me with about 50 MB of physical RAM free. I have seen the RomeTW.exe grow to 300 MB when there was more physical RAM available. I haven't seen my total virtual memory use go over 600 MB while running RTW v1.5. Under RTW v1.3, my virtual memory use would be up around 750 MB when the slowdown was occuring.

Red Harvest
12-16-2005, 17:03
Last time it seemed to affect people with 512mb of ram the most,
so i supose it would take 3x as long for you to relize if it really was a memory leak,
That reasoning has a big flaw. With zero leak a 512 MB system is using a great deal of the available physical memory to run the game, whereas a 768 or 1 GB machine is not. Assuming about 300 MB use normally yields about 200 MB differential for a 512 MB system, and 1200 MB for a 1.5 GB system. On that basis it would take 6 times as long to see the same effect. If the differential is ~100 MB it would take 11 times as long to see the same effect.



however most "if not all" with more than 512mb of ram never sufferd.
so it cant be a real memory leak or every 1 would notice after a given time period,

Perhaps you didn't notice, but CA *admitted* there was a memory leak in 1.3. That pretty much destroys the "there was no memory leak argument."

Regardless, I would wager that you have it backwards. Most suffered from it and it wasn't limited to ATi or NVidia cards, it "crossed party lines." I was skeptical of it until I saw it myself several times. I usually ignore "memory leak" threads as poorly configured systems, but RTW 1.3 was different. I didn't hear that many with 512 MB say they didn't have the leak. And of those who didn't several said they tweaked windows settings to get it to go way--meaning they also had the leak. Those who don't get to play extended sessions probably won't see the leak. I've never seein it happen form a one hour session. And before you go on about machine stability, this box has been completely stable. Since I'm able to recover the memory on the fly and relaunch, it is the app that is at fault.



A EXE leaking memory Has no real idea of your amount of ram, So it would not single out 512mb Systems.
So take from that what you will.
Which is what exactly? If you have a leak it is going to show up in the systems with the fewest resources first.

professorspatula
12-16-2005, 18:20
I was going to post about the memory leak last night - but once again, refrained from mentioning it, but you did anyway. Seems I'm not alone in noticing it then. I had RTW playing for about 4-5 hours last night. I was only playing for a couple of those hours, the rest of the time I was elsewhere. When I returned to the game and engaged in a battle, I noticed towards the end of the battle the game would pause briefly to access the harddisk - then it paused for about 15 seconds just trying to leave the battle. The memory leak was definitely back. Upon closing the game down, I noticed 120,000K of memory was being used and it took about 1-2 minutes before the memory was released. The memory leak was less perhaps than before, but still there.

Something else CA haven't fixed in their latest wondrous patch then. I really love whoever does their QA passing. I'm want to invite them round to Christmas dinner and then perhaps thump them.

Puzz3D
12-16-2005, 18:26
I noticed it after coming back to a session after dinner. It was mild at first, but got progressively worse. Was sucking up over 270 MB when I got out. Same routine as before.
Windows manages how much physical memory is allocated to an application, so it can change while the program is running. It appears that RTW uses about 600 MB of total memory: physical + virtual. It's possible that some other applications were swapped into virtual memory and RTW was allocated more physical memory. RTW may well use somewhat less memory when its first started than later on when more features have been accessed such as battles. If there is a memory leak, the total memory used by the application would continue to increase.

After I start RTW, I have 50 MB of physical memory free, 250 MB for RTW + 200 MB for all the other stuff I have running. I ran RTW for over 24 hours and I didn't get any slowdowns. I wasn't playing continuously, and RTW was minimized over most of that time, but I did play several turns just before quitting the game, and didn't observe any slowdown except portions of the map scrolling were slow until Windows swapped the entire map from virtual memory back into physical memory. The program wasn't using more than 600 MB of total memory when I finally quit.

GFX707
12-16-2005, 19:09
I noticed it after coming back to a session after dinner. It was mild at first, but got progressively worse. Was sucking up over 270 MB when I got out. Same routine as before.

I'm not trying to belittle your complaint as I hate badly optimised games but 270mb is NOTHING these days. Compare RTW to the system-cripplers known as Civ IV and X3 and you'll realise what a modest amount 270mb is. If an application taking up that amount of RAM is more than your system can handle, it really is time to get another 512mb....it's like $30 these days.

Red Harvest
12-16-2005, 19:21
I'm not trying to belittle your complaint as I hate badly optimised games but 270mb is NOTHING these days. Compare RTW to the system-cripplers known as Civ IV and X3 and you'll realise what a modest amount 270mb is. If an application taking up that amount of RAM is more than your system can handle, it really is time to get another 512mb....it's like $30 these days.

Clarification: that 270 MB is what the app is still using *when it is closed*. It is the source of all that disk activity. During the game RTW uses more and more virtual memory. Then it starts swapping back and forth to disk for longer stretches during the game. After taking ~45 seconds to shut down, and about another 20 seconds to get taskmanager to open, RTW's exe is still claiming that big chunk...and windows is trying to reclaim it. This leads to several minutes of solid disk activity where the amount of memory allocated actually GROWS (up to north of 330 MB at times) before declining and eventaully disappearing.

professorspatula
12-16-2005, 19:27
RTW v1.0/1.1/1.2 = No such memory leak. Game runs fine. Everyone's happy (because they've forgot about the other bugs back then).

RTW v1.3/1.4 = Memory leak. Game becomes unplayable after x amount of time on the same system as before when there was no memory leak.

RTW v1.5/1.6 = Memory leak. Game becomes less playable after x amount of time on the same system as before.

Once more the issue isn't: 'Get more Ram, it's cheap and you'll have nothing to complain about'. It's, 'there's a memory problem which wasn't prevalent in the older versions, but is there now and is a considerable annoyance that hasn't been fixed, despite CA's efforts.' If anything, I'd like to know why the memory leak is occuring when little has really changed in the game's engine. I don't think anyone should expect to just throw more ram into their system and forget about it.

Red Harvest
12-16-2005, 19:44
Windows manages how much physical memory is allocated to an application, so it can change while the program is running. It appears that RTW uses about 600 MB of total memory: physical + virtual. It's possible that some other applications were swapped into virtual memory and RTW was allocated more physical memory. RTW may well use somewhat less memory when its first started than later on when more features have been accessed such as battles. If there is a memory leak, the total memory used by the application would continue to increase.

After I start RTW, I have 50 MB of physical memory free, 250 MB for RTW + 200 MB for all the other stuff I have running. I ran RTW for over 24 hours and I didn't get any slowdowns. I wasn't playing continuously, and RTW was minimized over most of that time, but I did play several turns just before quitting the game, and didn't observe any slowdown except portions of the map scrolling were slow until Windows swapped the entire map from virtual memory back into physical memory. The program wasn't using more than 600 MB of total memory when I finally quit.

That map scrolling problem lag often the first visible symptom. After that I notice battles slowing down (sieges suffer the worst.) Whichever I notice first (campaign or battle lag), map scrolling is always a problem after the onset of symptoms--ditto for battle. It isn't constant either, it gets progressively worse the longer I play like that. When the map scrolling is a problem I can see the disk activity as I attempt to scroll across the map. I don't know what RTW is doing with the memory, but it is clear that it is no longer finding sufficient memory to run without constantly swapping back and forth to disk. That is an order of magnitude slower.

Battle load times and exit times also increase several fold (and get worse) as this occurs--and they continue to get progressively worse. It really acts like it only has a small portion of the physical RAM (and/or bandwidth) left available for actually running the active portions of the game at the time. If you've ever done troubleshooting on an integrated graphics PC at work that has too little memory (128 MB with Office apps in XP for instance) then you will easily recognize the behaviour. With such systems, adding a stick of memory helps alot...but the bandwidth is still restricted by the crappy integrated chipset, so while the horrible lag is removed, the system still lacks "snap" compard to non-integrated chipsets.

P.S. I don't know what minimizing would do. I never minimize the game.

Red Harvest
12-16-2005, 19:53
professerspatula,

I agree with much of that.

The other aspect that CA should be paying attention to is that adding memory merely masks the problem. The problem is still there and indicates errors in the base code that are accumulating. If it started with lag, and stayed the same, then I wouldn't be calling it a leak. It is the progressive nature of the problem that points to application flaws.

(If I had to shut down Excel every few hours because it got progressively slower, then I would know there was a problem with Excel. Ditto for IE, word, or any other app.)

Puzz3D
12-16-2005, 20:09
Red Harvest,

I forgot which operating system you are running. I use WinXP Professional + SP2. Probably on Saturday I can play a long continuous session and see what happens.

Red Harvest
12-16-2005, 20:18
I'm running XP Home SP2. The "footprint" I see for the OS is about the same as you.

Paul Peru
12-16-2005, 21:19
.
768 > 512 :san_wink:
.
How true that is!:san_cheesy:

anyway, I just took it for granted that the leak was taken away, but I'll post my findings here later.

Its a bit lame/sad if it's still there whan they said it wasn't...:san_cry:

Kaldhore
12-16-2005, 22:23
1 Gig of Ram and I got memory leaks in 1.3, but only after 4 hours +, and the game was still playable, it just took 10 mins to shut it down.

Havent installed the patch yet as Im busy atm.

Try Civ4 for a nightmare of memory usage tho

Red Harvest
12-16-2005, 23:59
Its a bit lame/sad if it's still there whan they said it wasn't...:san_cry:

To be fair, they said that the memory leak was fixed in the "campaign map." So this could leave any number of other memory leaks...and it might have just been a single thing that was found and fixed, but there could and probably were multiple problems.

demon rob
12-17-2005, 01:48
Try Civ4 for a nightmare of memory usage tho

Civ4 - another bad move to 3d! Wonder how galciv2 is going to be after it goes 3d as well.

Kaldhore - have you tried the Civ4 memory fixer? (available through apolyton or civ fanatics) Works brilliantly. A third party app fixing the memory use of the main program - incredibly inneficient programming by Firaxis it seems in the way it allocates 3d objects in directx.

red comyn
12-17-2005, 09:48
To be fair, they said that the memory leak was fixed in the "campaign map." .


No deffinalty still there in campaign map, as previously stated just takes longer. Accidently left the game running when I went to work for about 7 hours. Took ages to get it to do anything when I came back, very scientifically it took exactly they time to swear at it a bit...smoke a ciggie....swear some more.... go make a coffee.... smoke two more fags and then the load/save/exit screen came up. Although I doubt anyone will play for this long and i hadnt noticed any problems for the two hours I was playing before I left the pc, where as before the patch the slow down was noticable in this time frame. Note this is with BI installed but playing ROME

KSEG
12-17-2005, 09:53
How can someone play a game continuously for 4 hours?
I rarely play more than a haour conitinuously.

Atilius
12-17-2005, 10:10
Accidently left the game running when I went to work for about 7 hours. Took ages to get it to do anything when I came back

I don't think you're describing a memory leak here. The game won't leak memory if it's not doing anything. I'm an expert memory leaker so I know something about this. Perhaps what you're seeing is the OS trying to reclaim memory written to disk for an inactive process.

red comyn
12-17-2005, 10:31
I don't think you're describing a memory leak here. The game won't leak memory if it's not doing anything. I'm an expert memory leaker so I know something about this. Perhaps what you're seeing is the OS trying to reclaim memory written to disk for an inactive process.


More than possibly,not an expert on these things, much like the contestants on catch phrase I "say what I see" but ill take your word for it.... although when i brought up the task manager to exit the game, the memory usage was HUGE and had the little insufficiant virtual memory warning up. Which it did after no time before the patch, would trying to recalim memory usage do this too?

Kaldhore
12-17-2005, 11:25
How can someone play a game continuously for 4 hours?
I rarely play more than a haour conitinuously.

4 Hours is actually quite small, It can be up to 12 hours on days off (with breaks in between)

Kaldhore
12-17-2005, 11:27
Civ4 - another bad move to 3d! Wonder how galciv2 is going to be after it goes 3d as well.

Kaldhore - have you tried the Civ4 memory fixer? (available through apolyton or civ fanatics) Works brilliantly. A third party app fixing the memory use of the main program - incredibly inneficient programming by Firaxis it seems in the way it allocates 3d objects in directx.

I rarely Play it atm, but If they havent patched when I go back to it I'll try that fix. Cheers

fallen851
12-18-2005, 09:19
I'm an expert memory leaker.

Can I see your qualifications?

Puzz3D
12-18-2005, 21:13
I have WinXP + SP2 and 512 MB RAM. Normally 300 MB of that RAM is free and my pagefile is 350 MB in size. When I start RTW v1.5 and reload my campaign, the game uses 250 MB of the available RAM and adds 300 MB to the page file. I ran the game for 48 hours without exiting; playing on and off within that period. While the RAM usage stayed around 250 MB for the 48 hour period, the pagefile usage gradually increased from the inital 300 MB to 600 MB. At this point I was experiencing significant slowdowns as WinXP juggled parts of the program in and out of the pagefile depending on what I was doing in the game. If I had 1000 MB of RAM, I probably wouldn't have experienced any slowdowns.

Atilius
12-18-2005, 22:11
Can I see your qualifications?

Well, I can't find my Memory Leakers Anonymous membership card so here's some typical AtiliusCode:


void SayHelloToFallen( void )
{
int len = 16;

// Allocate memory for the text message:
//
char* message = new char[ len ];

message = "Hi fallen851\n";

cout << message << endl;

// Oops, the variable "message" is about to go out of scope and
// I haven't deleted the memory it points to - this memory will be
// lost until the program terminates

return;
}

int main( void )
{
SayHelloToFallen();
return 0;
}

Red Harvest
12-19-2005, 18:59
I have WinXP + SP2 and 512 MB RAM. Normally 300 MB of that RAM is free and my pagefile is 350 MB in size. When I start RTW v1.5 and reload my campaign, the game uses 250 MB of the available RAM and adds 300 MB to the page file. I ran the game for 48 hours without exiting; playing on and off within that period. While the RAM usage stayed around 250 MB for the 48 hour period, the pagefile usage gradually increased from the inital 300 MB to 600 MB. At this point I was experiencing significant slowdowns as WinXP juggled parts of the program in and out of the pagefile depending on what I was doing in the game. If I had 1000 MB of RAM, I probably wouldn't have experienced any slowdowns.

Puzz3D,

I left task manager running while playing for a few hours. It is using more and more pagefile as time passes (at least as new battles load.) Eventually it hits the limit and things lag. Interestingly...Windows says the limit is 1536 with 768 initial, but the game is maxing at 768 and I think this is where the lag begins. Either XP is actively fighting to get back to 768 (countering the leak) or the app is not requesting or getting more space. These are the defaults and "recommended" by XP itself for my level of RAM. I do not recall having set any of these even though the "custom" button is checked...so I'm trying to figure out why it would be that way. I've not tried to tweak XP the way I used to tweak 98. Guess it is time to start.

Level of detail, shadows, and the number/size of battles (particularly sieges) will likely greatly impact the total memory being used and the page file growth. I max everything, and that runs well for a few hours.

Puzz3D
12-19-2005, 20:13
I left task manager running while playing for a few hours. It is using more and more pagefile as time passes (at least as new battles load.) Eventually it hits the limit and things lag. Interestingly...Windows says the limit is 1536 with 768 initial, but the game is maxing at 768 and I think this is where the lag begins. Either XP is actively fighting to get back to 768 (countering the leak) or the app is not requesting or getting more space. These are the defaults and "recommended" by XP itself for my level of RAM. I do not recall having set any of these even though the "custom" button is checked...so I'm trying to figure out why it would be that way.
I let WinXP manage the size of the pagefile, so the limit may be the available disk space which on my system was 10 GB at the time. There is something I observed that I didn't get into in my previous post.

I had RTW minimized for the last 12 hours of the 48 hour period it was running. During that time, WinXP eventually swapped all but 1 MB of RTW out of RAM into the pagefile leaving 300 MB of RAM free. My pagefile was 950 MB. Since 300 MB of that belongs to things other than RTW, the game was using 650 MB. That's about the same amount of total memory (RAM + virtual memory) that RTW uses when I first start it. Now an interesting thing happened when I reactivated RTW and started playing the campaign. WinXP gave 250 MB of the available RAM to RTW, but my pagefile was still using 950 MB. I then fought a battle, and RTW RAM usage increased to 300 MB, and the pagefile was still at 950 MB. During the battle, when I would move the camera or give commands I was getting long pauses as the game had to retrieve data from the pagefile. After the battle, I got long pauses when I hit end turn as the pagefile was again accessed. So, despite the fact that RTW was now using about the same amount of RAM as it does when I first start it, WinXP had to go back to the pagefile quite often for stuff whenever I did something in the game. That suggests that WinXP is shadowing what's in RAM in the pagefile, and that what's in RAM is being inefficiently allocated to data that isn't needed while data that is needed is only in the pagefile. The shadowing might be part of WinXP's memory management. It could be that after RTW has been running for a while, WinXP is having a hard time figuring out which data should be in RAM. So, I'm not sure it's a memory leak in the sense that RTW's memory use keeps increasing, but there is something going on which affects systems that only have 512 MB of RAM while systems with 1 GB seem relatively immune possibly because more of the game resides in RAM.



Level of detail, shadows, and the number/size of battles (particularly sieges) will likely greatly impact the total memory being used and the page file growth. I max everything, and that runs well for a few hours.
This is probably why I don't see a slowdown for 6 hours or more because I don't have everything maxed. I play with no grass, no shadows and medium detail.

Paul Peru
12-19-2005, 23:42
I just played a few turns.
Not 1.5, though, BI 1.6, unmodded Saxon campaign.
Memory footprints of the RTW:BI exe were as follows:
pre-load, main menu 132
first turn after load 239
after battle 256
next turn 270
next turn 277
new battle 348
turn 359
turn 363
battle 371
turn 374
quick save/load 365
new quick save/load 369
quit campaign to main menu 280
continue vampaign 368
quit campaign to main menu 280!!
exit, go to main menu, 131
load 241

So in those few turns there has been a leak of 150 MB, which I can't get back without exiting the program.

edit: a slightly longer session today: up to 450, 350 retained after quitting to main menu.

Puzz3D
12-20-2005, 00:42
I wonder how much RAM this game really needs to avoid disk thrashing. The 256 MB minimum requirement on the box is misleading because the game actually needs a lot more than that to function, and a 256 MB RAM system will only have about 128 MB of RAM free.