Log in

View Full Version : Fix The Memory Leak!



Red Harvest
11-15-2005, 19:00
ARRRRGGGGGGG!!!

RTW 1.3 is REALLY ticking me off. This memory leak is just awful. :charge: Seriously, this makes for some really painfully bad battles. Once the leak hits most of the problem is early in the battle, while the game is hitting the disk for several seconds at a time for several minutes. This is what fire arrrows used to do in previous versions...before I modded them out for archers.

Let's put it this way, the memory leak is making a lot of battles "unfun" excercises. The frequent rebooting to deal with it is a pain, particularly since it takes so long to shut down after playing RTW.

Find the leak(s) and kill it/them.

Garvanko
11-15-2005, 19:04
Instead of rebooting, just place your computer on standby. Much quicker, accomplishes the same goals as a full reboot.

I think.

Puzz3D
11-15-2005, 19:27
Exiting RTW recovers the memory under WinXP, but it can take a while. I have 512 MB RAM, and I was restarting RTW after every 3 battles to avoid the slowdown. I think this problem would be grounds for demanding a refund.

professorspatula
11-15-2005, 19:46
I find I experience the memory leak on the strategy map first, which then affects the battles. If I leave the game on the strategy map for a period of time and return, the game is unplayable. If I leave the game during a battle for the same period of time, or thereabouts, I don't experience the leak. After a while no matter what, the game becomes more and more unplayable though. It's all been said loads of times before though. What a shame a quick fix/patch couldn't have been released to address the issue rather to have to wait for a bigger (possibly further not-fully-tested) patch at a later date.

Watchman
11-15-2005, 21:35
Weird, that. I've never had much of a problem with it. I've noticed the tactical battles eventually start slowing down if I play long enough straight (and this means like 6+ hours), but once I quit the game the unsettlingly large number of used memory in the control panel starts dwindling pretty fast...

And mine's not even a remarkably powerful comp.

A.Saturnus
11-15-2005, 21:38
I also didn´t experience a problem. But then, I have 1 GB RAM.

antisocialmunky
11-15-2005, 22:56
You can get one of them memory clearing programs. I use Freemem.

professorspatula
11-15-2005, 23:19
Actually I did just get the leak during a big siege battle. I closed RTW down afterwards, and noticed RTW was still using 159,000K of memory. For the next 2 minutes, the memory usage increased to 182,000K, before finally decreasing and going completely. I've seen it much higher before, and take even longer to close down fully. Perhaps all the playtesters had 2Gig of Ram, played for only half an hour at a time, and hence didn't notice the leak.

Puzz3D
11-15-2005, 23:35
Perhaps all the playtesters had 2Gig of Ram, played for only half an hour at a time, and hence didn't notice the leak.
Playtesters? There were no playtesters outside of what CA could do inhouse.

Mouzafphaerre
11-16-2005, 00:33
I also didn´t experience a problem. But then, I have 1 GB RAM.
.
It's almost established that the leak hits on 512M and lower.
.

Oaty
11-16-2005, 04:24
I noticed that BI tends to use a lot of pagefile memory and was running slow at times. Since I was fortunate enough to have 2 hard drives, I switched page file from the C:/D: drive to a partition on another hard drive and increased it to 2 GB from 500 MB and it enhanced the performance of the game but not to optimum.

So if you have 2 hard drives switch the page file to your other hard drive that does not have the operating system on it and the performance should be boosted.

To increase/relocate your pagefile

Right click on my computer
properties
advanced
(perfomance) settings
advanced
virtual memory
change....................... and from there selct wich drive and how much space

Just A Girl
11-16-2005, 04:37
You guys shure this is a memory leak?

Dosent sound like its leaking memory from the descriptions. "not actual physical ram any way"
Sounds like a virtual ram problem ,
You guys set your virtual ram right? and defraged the virtual ram drive?

I usualy have a spare hard drive used just for virtual ram,
I also set my virtual ram MAX and min as the same value,

"windows MUST have enough virtual ram, When it does not have enough virtual ram, It will make more. This slows down your pc,"
It sounds to me like this is whats happening,.

I should probably patch to 1.3 and explore this problem a bit more.

A lil busy to do it right now, but i probably will later.

Mouzafphaerre
11-16-2005, 04:53
.
When the bug hits, after you quit the game, the process remains in the memory with consumption ranging from 80 to 250M. You have to force it to shut down via Task Manager.
.

Red Harvest
11-16-2005, 05:03
You guys shure this is a memory leak?

Dosent sound like its leaking memory from the descriptions. "not actual physical ram any way"
Sounds like a virtual ram problem ,
You guys set your virtual ram right? and defraged the virtual ram drive?

I usualy have a spare hard drive used just for virtual ram,
I also set my virtual ram MAX and min as the same value,

"windows MUST have enough virtual ram, When it does not have enough virtual ram, It will make more. This slows down your pc,"
It sounds to me like this is whats happening,.

I should probably patch to 1.3 and explore this problem a bit more.

A lil busy to do it right now, but i probably will later.

Definitely a memory leak, as it takes up more and more of your physical RAM. It doesn't release it when the app closes (at least in any reasonable amount of time.) It is using up all available physical RAM which is why it starts writing to the disk, the app is taking more than 512 MB total. If you have extra RAM, then you can go on for a long time without noticing the leak. But with 512 MB the margin between "base memory" usage of the game/OS/etc. and the actual memory available is not large, probably between 100 and 200 MB. With 1 GB of memory the differential would be 5 times larger (or more.) That would mean it would take very long sessions to produce the same effect.

Just A Girl
11-16-2005, 05:03
Ah,
And this happens to any 1 with 512mb or less?

It still sounds like the game Uses your 512mb.
Says Damn this isnot enough,
Over runs in to virtual ram,
Says Damn this aint enough either.
Windows Increases virtual ram to prevent game shuting down cos of lack of memory.
The proces of increasing virtual ram then slows down the game,
People get upset,
restart.
The game is then stuck in a white loop trying to increase virtual ram so the game wont close,
whilst also trying to close the game at users request,

Im just thinking out loud here though,
So i guess i better go install 1.3
I have a pc here with 512mb and one with 1gb Bothe 2.8ghz.
and i have a 1333 512mb,
i will see what happens on each.

P.S

How long should i leave the game on the campaign map to notice this prob on avarage?

Red Harvest
11-17-2005, 05:05
Playtesters? There were no playtesters outside of what CA could do inhouse.

Puzz3D,

That wouldn't surprise me, do you know for sure that this was the case?

Red Harvest
11-17-2005, 05:09
I did a test tonight. After a few hours the game got very choppy as usual. This time instead of rebooting, I let the machine sit for about 20-30 minutes. After taking a long time to exit, it was hitting the disk like mad for a few minutes before I left the room (same as always.) When I came back "normal" responsiveness was back. So XP did clean up the mess eventually. Rebooting is still probably faster from what I've seen.

Just A Girl
11-17-2005, 07:41
hey im sorry people,
But on a amd 1333 512mb "PC133" with 2gb Virtual ram min and max, Using v1.3
I dont notice the problems you are reporting.
"both the 2.8ghz pcs have 1gb+ ram so couldnt test on them"

But You can get a program called MAXMEM.
Form a company called Analogx
That lil sucker will free up any Memory that windows cant free up.

thats about all i can say to help as i dont suffer from this prob.
But then again flaiming arrows and bolders dont afect my game either and never have,



-EDIT-

Ok im a idiot,
I downloaded 1.3 last night,
i thought i installed it then went to bed,
Obviously i did not,
So i tested that stuff out in v 1.2

Im Now installing v1.3
So Maby il end up geting Agrivated at the memory leak 2

Mouzafphaerre
11-17-2005, 10:06
.
It stroke at its worst a few minutes ago. Usually, upon realizing the lags on the campmap, I would exit the game, kill the leak and play again. I neglected and took it longer. The game became virtually unresponsive and totally unplayable on the battle deployment screen. I had to kill it calling up Task Manager.

Please CA, this is the most important thing to address.
.

AquaLurker
11-17-2005, 12:44
Frustrating news. As one of my online playmate suggested, sloppy programing from CA. Hope they get the patch done soon.

Colt374
11-17-2005, 12:56
This problem is driving me nuts too. This is the first game I've run into with my new PC that has made me have to consider getting more RAM than my current 512MB. And for no reason other than to work around a bug. That is just wrong.

Please CA, address this soon.

Colt.

P.S. To all those people who aren't getting this problem, consider your self lucky and don't bother trying to convince others it is an issue with their system. Too many people are getting it for it NOT to be caused by the game itself.

Just A Girl
11-17-2005, 12:57
I have been playing v1.3 since my last post,
"i checked and thats 5 hours"
I even did alt tab and opend a difrent program then returned to the game,

i sufferd no memory leaks or similar symptoms,
I was using my
Amd 1333, 512mb "pc 133" , ati redeon9250 256mb.
With 2gb virtual ram Which is stored on my f: drive.
my Windows drive c: "xp pro sp2"
is a independant hard drive, and my games are installed to d:


P.s

A common default setting in bios like
video ram shaddowing
Could cause problems like this, Most times manufacturers advize you to disable this option any way,
but for some reason they are set as the default option,
Causes lots of CTD's too.

So it could Always be a problem with the pc,

As some may know I am not A fan of RTW,
but i dont see any memory leaks in my game, So i dunno.....
maby you should stop yelling at them and check out your own config.

"I would have had to have been very lucky not to have a program that sufferd this problem.. But i cant say im not lucky either. So dont think i said its definatly not a memory leak :) but there are other possibilatys"

professorspatula
11-17-2005, 17:02
The issue is that this never happened before the recent patch. Our systems worked perfectly before. The fact that something has changed and caused so many people to experience the memory problem means it's something CA should address/fix, regardless of whether or not our system has such or such setting. No-one should have to mess around with a bios setting or virtual ram if everything was fine before. It's not like the game has changed enough to warrant needing more Ram or whatever.

Orda Khan
11-17-2005, 17:25
The only problem I have ( which is not much of a problem ) is that exiting the game is slow. As in 5 seconds or so. I have 512Mb and have seen none of the battle slow-downs that are reported here. I tested this for hours of play and experienced no problems in game. Maybe there is an explanation

.....Orda

MulusMariae
11-17-2005, 18:01
Greetings, all --
For anyone willing/able to spend time testing this... I will submit a unproven/untested "hunch" that the problem might be related to the
game's use of sound. I have seen the problem strike while the game is
completely "inactive" on a machine just left running when I went to bed...
Apparently no problem when I went to bed... no keystrokes overnight...
massive problems with the machine in the morning... task manager showed
over 512M of memory used by the game. What else is happening with no KB input, except switching the sound now and then, and whatever "animation" happens on the strategy map?

As I said... just a hunch, FWIW.

cheers to all...

Puzz3D
11-17-2005, 18:09
That wouldn't surprise me, do you know for sure that this was the case?
No, but the people I know who have done playtesting in the past would never have missed the memory leak, the naval invasion issue, the pila issue, roman diplomacy issues or the multiplayer replay issue. Then again all the people I know who have done playtesting in the past don't play RTW anymore, so maybe CA went elsewhere. I think CA made a sincere effort to improve the gameplay in this patch, but I don't want people here to think that community based playtesters let them down.

Mouzafphaerre
11-17-2005, 19:18
.
As professorspatula say, please don't waste your valuable time trying to disprove this bug. It's right there and hitting so many players. Just consider yourselves lucky and move on.

As most bugs it's intermittent and may not be occuring on everybody's system. For instance, in two of the three battles I played lastly the AI reinforcements bug didn't hit although my army combination was matching the proposed pattern of it.

As for offering temporary workarounds for the bug, not that I'm too confident on their effectiveness but thanks for your suggestions.
.

Rilder
11-18-2005, 00:53
yea its there, i got 2 pics showing the cpu usage(via task manager) when i first started the game and the cpu usage right before i exited the game

Heres the first pic just afteri started the game
https://img241.imageshack.us/img241/3733/memleak1fa.jpg
And heres just before i exited... usualy it gets up to 200,000 before i exit due to lag

512 Ram of course
https://img245.imageshack.us/img245/2666/mem8vn.jpg

Just A Girl
11-18-2005, 11:28
If there Is a memory leak You can Use Analogx's Maxmem to free up your ram If windows wont do it for you,
http://www.analogx.com/files/maxmemi.exe
its 214k so a really small download,
Easy enough to use aswell.

Its not a fix Its not a work around,
its just something that can free up your ram without having to restart your pc After you exit the game,

Prehaps it will make Life a little easier untill the leak is fixed,

Hope it helps

Rilder
11-19-2005, 00:17
yea i dled this thing called free ram xp pro i can use it while the games running and it really helps... i played 4 hours today :P

Mouzafphaerre
11-19-2005, 01:09
.
I played like ten hours yesterday and quit before engaging in a battle realizing the leak had gone mad. Really, it was 205,som,eth,ing in Task Manager. ~:eek:
.

Red Harvest
11-19-2005, 08:47
Did a check of task manager tonight:

Shutting down the game took ~45 seconds (30 seconds once the exit screen actually came up.)

Took me awhile to get into task manager, so I don't know what the memory usage was before...but by the time I got in it was *down* to 277 MB...so it was well over 300 MB when things got really choppy in the game. Took 4 minutes solid of it hitting the disk before it cleared.

This one was moderate, I've had worse.

Mouzafphaerre
11-20-2005, 01:27
.
So have I. I was careless not to save and exit in time and had to forcefully kill the game in a battle scene. Thankfully the autosave file didn't get corrupt. (Actually I only had one corrupt savefile in 1.3/1.4, which is a major improvement from MTW 2.01.)
.

DarKorg
11-21-2005, 05:22
I don't have any problem ~:confused:
I still bame the users side :duel:

Red Harvest
11-21-2005, 06:33
I don't have any problem ~:confused:
I still bame the users side :duel:

Considering it didn't happen until 1.3, it isn't the users side. ~:rolleyes:

Mouzafphaerre
11-21-2005, 06:39
.
I've noticed in my latest two sessions that the leak began to hit earlier than it would. :inquisitive:
.

Michael the Brave
11-21-2005, 07:41
Does the memory leak affect BI aswell or only RTW 1.3 ?

professorspatula
11-21-2005, 15:28
Both. If anything it's worse in BI, but then I've played BI much more than RTW 1.3 so it's really probably the same.

Butcher
11-21-2005, 16:05
Sounds great. Glad I haven't got BI yet, or reinstalled RTW after getting a new Hard drive.
I'll wait for a patch..

Razor1952
11-23-2005, 04:25
I'm using 512 Ram and 1.3 vanilla RTW, and certainly have the same problem.

I notice that the temporary process someting like ~005temp can be seen in task manager, and when the "leak" is bad then you can get extra temporary processes started. These are associated with RTW because stopping them stops RTW!.

I must admit I've taken to a quick crash out of RTW using task manger stopping the temporary processes (or rtw.exe) .

And don't anyone bother telling me that stopping processes like that is bad for your computer. As long as you don't stop critical processes you are not going to get into trouble.

SadOldGoth
11-23-2005, 14:27
All,
I don't really understand what the big problem is. Yes, there is a memory leak, which is not great.
In XP, start the Task manager, click the Performance tab.
Start RTW, play for a while, I only see the problem after playing 2-3 hours.
Exit RTW, look at the Task manager. You'll see the memory line decreasing, took no longer than 1-2 minutes so far, could be more if more memory is taken up due to the hard drive needing to clear out the virtual memory. At some point all virtual memory is cleared.

Start RTW again, enjoy for the next couple of hours.

If you have been playing for hours on end, take a break anyway. If you actually work with PCs it's recommended to take at least a 5 minute break every hour so your eyes can relax a bit...

SadOldGoth

Kraxis
11-23-2005, 16:03
Considering it didn't happen until 1.3, it isn't the users side. ~:rolleyes:
Ha! You installed the patch... User side problem.~;p ~;)

Red Harvest
11-23-2005, 18:10
All,
I don't really understand what the big problem is. Yes, there is a memory leak, which is not great.
In XP, start the Task manager, click the Performance tab.
Start RTW, play for a while, I only see the problem after playing 2-3 hours.
Exit RTW, look at the Task manager. You'll see the memory line decreasing, took no longer than 1-2 minutes so far, could be more if more memory is taken up due to the hard drive needing to clear out the virtual memory. At some point all virtual memory is cleared.

Start RTW again, enjoy for the next couple of hours.

If you have been playing for hours on end, take a break anyway. If you actually work with PCs it's recommended to take at least a 5 minute break every hour so your eyes can relax a bit...

SadOldGoth

Considering that it starts slowing down battles fairly early on...and later you get stuck playing a big battle with fairly massive lag, it is a problem. Battles like that are seriously unfun, and they take a lot of time--doubling the pain. I already have plenty of interruptions as it is. I don't need another artificial one, thank you.

Shutdown and start up time to clear is 4-5 minutes when this gets to be a problem. I've checked this multiple times. It is using about 300 MB's (and much of this appears to be on disk) by the time I give up. Doesn't happen much early in a campaign, but gets really bad later. The shut down sequence is a pain, since there are big delays between each action because of the memory leak (Reminds me of install routines, and that is not a good thing.) So I end up babysitting it if I'm going to resume playing. The duration of the onset of serious lag to restart is typically about half an hour. So as a user I get about one half hour of irritation, for every 2-3 hours of play. Gee, thanks.

Somehow I doubt CA really wants to tell customers, "You shouldn't play our game for more than an hour or two. We recommend you go do something else." Once I've shutdown there is a very good chance that I'll be unable to come back.

Puzz3D
11-23-2005, 21:37
Once I've shutdown there is a very good chance that I'll be unable to come back.
You can avoid the wait by killing the RomeTW.exe process in task manager. However, since you have to save and reload the game on every turn anyway to avoid the naval invasion problem, you could restart the game after every turn. CA should really allow people to stop and smell the flowers.

Just A Girl
11-23-2005, 21:51
Indeed. I love flowers.

Puzz3D
11-23-2005, 22:24
Indeed. I love flowers.
Tulips are my favorite.

I believe the memory leak is grounds for getting a refund because it causes the game to eventually stop working. If CA doesn't fix this, I will ask for a refund.

Mouzafphaerre
11-29-2005, 18:32
.
Yesterday I got a record of 288M! ~:eek: Today it was moderate at 250M. ~:mecry:

Please don't leave this unattended.

Btw, it seems certain that the problem is related to the stratmap. No leak happened after a quite long session of custom battles.
.

Heinrich VI
12-01-2005, 02:40
P4 1,7
512MB DDR266

ive stopped playing BI because of this "§$%& memory leak after i had to kill the rtw task in disgust while waiting for the game to load 2-fullstacks + huge city (rome) battle. ~:mecry:

i have yet to try vanilla 1.3 since im mostly playing mods on 1.2 now but id like to know if it is affected too.

@CA: FIX IT!

Krauser
12-01-2005, 02:52
I don't know about BI but vanilla RTW 1.3 plays fine. I've got 640MB RAM, just a little more than 512MB that everyone says is the borderline for the leak. That seems to be true.

Mouzafphaerre
12-01-2005, 03:19
.
1.3 is as doomed as 1.4 (BI). ~:mecry:
.

Red Harvest
12-01-2005, 05:56
I don't know about BI but vanilla RTW 1.3 plays fine. I've got 640MB RAM, just a little more than 512MB that everyone says is the borderline for the leak. That seems to be true.
Vanilla RTW 1.3 has the problem.

Kaldhore
12-01-2005, 06:35
Ive just played 7 hours straight on RTW 1.3, Sound crashed the game, but I think theres a sound problem anyway on my pc....

Only thing was the game took a long time to get out of memory once I shut it down. Other than my battles were fine - no slowdown etc

Maybe its a graphic specific thats causing the leak - and some people arent using that specific?

Red Harvest
12-01-2005, 07:01
It is way too generalized for that. Most importantly, it didn't happen in previous releases. Why is Rome sucking up extra resources and not releasing them when sitting idle? I don't know, but it clearly is doing so, and to release them takes quite awhile.

Duke John
12-01-2005, 08:55
I read somewhere that the lag was reduced/gone when Shadows were set to off. From what I see ingame CA has introduced a new shadowsystem; objects now cast "shadows" on other objects. When an unit is partially under a tree some soldiers are darker than the ones standing in the light. Perhaps CA messed up part of the the shadow code.

Mouzafphaerre
12-01-2005, 13:08
.
The problem is somewhere in the strategic map code, not in the battles. As I said earlier, hours of custom battles run without any leak, but anything more than approximately two hours on strategic levels results in the bug.
.

Just A Girl
12-01-2005, 13:17
Tulips are my favorite.


I love roses.

Kekvit Irae
12-01-2005, 15:02
I'd like to take this time to remind you all that discussion of cd cracks and various other "grey areas" of the law is not allowed here, so please get back on topic and enjoy the flowers.

Just A Girl
12-01-2005, 15:05
I'd like to take this time to remind you all that discussion of cd cracks and various other "grey areas" of the law is not allowed here, so please get back on topic and enjoy the flowers.

:bow:

I will be shure to bear that in mind in the future,
I will confine such disscussions to PM if its acceptable...?

Kekvit Irae
12-01-2005, 15:08
Private Messages are perfectly fine, so long as it's just a discussion (IE: no offering cracks or whatever over PM).

Red Harvest
12-01-2005, 18:43
.
The problem is somewhere in the strategic map code, not in the battles. As I said earlier, hours of custom battles run without any leak, but anything more than approximately two hours on strategic levels results in the bug.
.
I've had it happen on custom battles too during unit testing. Can't remember the specifics, but I noted it because I had *only* done custom battles during the session.

Red Harvest
12-01-2005, 18:53
I read somewhere that the lag was reduced/gone when Shadows were set to off. From what I see ingame CA has introduced a new shadowsystem; objects now cast "shadows" on other objects. When an unit is partially under a tree some soldiers are darker than the ones standing in the light. Perhaps CA messed up part of the the shadow code.

This is a possibility. I have not experimented with that setting, since shadows are not ever truly off anyway. I wonder if the new shadows generate some sort of secondary temporary "sprite" type files that accumulate over time? Whatever is happening, the game is not clearing some temporary files it makes.

I remember Jerome talking about the shadows they were working on back when we were trying to figure out why spear primary/sword secondary non-phalanx didn't work.

Another possibility is that CA has the game trying to periodically take some sort of snapshots of all the states for variables as part of the load/save fix. Things might not be getting cleared as they should be. (Of course this doesn't explain how this once happened to me in custom battle testing...)

There are some glitches: such as the stuck fighting animation where individuals get struck repeatedly by invisible enemies and forced away from the formation, the bow & arrow icon on the unit card not shutting off at times when you run out of ammo, siege gear not being buildable and requiring a reload, the ghost army/character that sometimes appears on the left hand corner of the campaign map, etc.

Mouzafphaerre
12-01-2005, 20:00
I've had it happen on custom battles too during unit testing. Can't remember the specifics, but I noted it because I had *only* done custom battles during the session.
.
That would be true; my "testing" was in fact too short to determine it.
.

Just A Girl
12-01-2005, 20:30
It could be productive for People to State What settings they use when they play RTW.
And then also state if they suffer the memory leak or not.

Il start and if you think its a good idea. You can add yours.
But dont Get angry at me for trying to help,
As far as i know CA have not acknowlaged there is a problem.
So im only trying to be helpful...

My setings,
(I do not suffer the Memory leak Running with 512mb)

Battle map = 800x 600 (i use a tv so i need this setting)
Strat map, - 1024 x 768, (id use 800x600 so i can read But no option)

Preformance, Custom.
Tick show advanced.

Antialiazing LOW.
unit scale HUGE
Terrain detail MED
Effects detail MED
Unit detail MED
Grass detail MED
Vegitation details Med
Buildings details Lowest.

The little tick box options are as follows.
I have no ticks in,
Wide screen
detail unit shadows
campaign shadows
reflection/glints (although i suffer no leak with this enabled either)
De-synk Anim (Also this option i sometimes use with no memory leak)

I then have ticks in The following Tick boxes.

Smoke/Dust
Battle map shadows
Unit shaders,

Maby we can find out what causes it like this.

:bow: