Author Topic: The dreaded memory leak  (Read 11752 times)

Wildman

  • Founder
  • Eldest
  • ****
  • Posts: 1036
  • Karma: 9
  • Mental Case
Re: The dreaded memory leak
« Reply #15 on: Aug 30, 2010; 06:53 AM »
Quote from: "Bryan"
Quote from: "Wildman"
does the problem clear up after restarting the game. Do you have a way of monitoring your ram usage.

Persistent as hell,restarting works but it might still happen again after say,an hour.
I've dedicated my entire RAM to the ungrateful lad,got nothing else running and I even set HGL's priority to Above High at task manager's processes tab...What can I say.

Modem problem still not solved btw,soon as it's solved I'm posting my specs just in case something gives a pointer.

That sounds like the memory leak, when your memory usage gos over 80% the game will crash or lock up, sometimes locking up your system as well.

If I remember right there is a memory monitor in the task manager in Win 7, turn it on and watch it to see what your memory is doing both while idle and playing HG:L, Win 7 on my machine uses between 20-25% of my memory at idle (thats with 4Gig) approximately 1Gig of memory. With your system that would only leave about 2Gig to run peripherals and applications, with a memory hog like HG:L it may not be enough, like I said earlier my XP boot still crashes once in a while and thats the same machine just a different HD, OS
All is cloaked in darkness and the darkness is my home. I shun the light but still I fight, until the dark is safe once again.

thumper

  • Guest
Re: The dreaded memory leak
« Reply #16 on: Aug 30, 2010; 10:05 PM »
I have a similar amount of RAM as you do Wildman - I setup the Win 7 monitor to capture memory use late in the game as I suspected it had something to do with the outdoor levels that lead to Necropolis. Even with 4G I could see the game chewing up RAM and threatening to bite into virutal RAM (disk) the longer I played it. I'm not sure if it is related to how long you play or any particular levels/events, but in the old MP days (on a less powerful rig) the lead-in levels to Molly would hang/crash my machine about 75% of the time and it was always the memory leak that did me in...

Now I have a much better system (OS and HW) and I haven't had HGL crash the system (yet), but something I learned almost 30 years ago:

Good Hardware Cannot Fix Bad Code

[smilie=cray.gif]

Wildman

  • Founder
  • Eldest
  • ****
  • Posts: 1036
  • Karma: 9
  • Mental Case
Re: The dreaded memory leak
« Reply #17 on: Aug 31, 2010; 04:22 AM »
That is a true statement, but we can still find work arounds for that bad code....it sucks.

One of the things that I have noticed is that the game actually seems to play better using a 64bit OS. That maybe because the game was created on a 64bit OS, then transferred to 32bit, I'm probably wrong but its a good theory anyway.  :roll:

I don't really think that the memory leak is totally tied to the amount of time you play so much as to the effects and how busy the game can get in certain areas.

There are triggers in the code that are supposed to tell the system that certain info is no longer needed, so that info no longer needs to be stored and to free up some memory, but apparently that code/trigger/node or what ever you want to call it, ether isn't there or isn't functioning properly.
All is cloaked in darkness and the darkness is my home. I shun the light but still I fight, until the dark is safe once again.

thumper

  • Guest
Re: The dreaded memory leak
« Reply #18 on: Aug 31, 2010; 05:23 AM »
Quote from: "Wildman"
That is a true statement, but we can still find work arounds for that bad code....it sucks.

One of the things that I have noticed is that the game actually seems to play better using a 64bit OS. That maybe because the game was created on a 64bit OS, then transferred to 32bit, I'm probably wrong but its a good theory anyway.  :roll:


Actually a good theory Wildman, if true (anyone confirm this?). I haven't had a crash since going 64 bit and can honestly say that when at work we moved our WAS applications from 32 bit AIX to 64 bit AIX a few years back we experienced some problems with compiling the home-grown code. The enterprise packages (like Oracle and various middle-ware packages) were no problem and the HW was 64 bit from the get-go so most of the system level stuff like batch and CHRON jobs were seamless.... might explain a few odd ball glitches inherent in HGL (passing of PARMS was an issue for our Apps group IIRC).

ganaeis

  • Nameless
  • *
  • Posts: 1
  • Karma: 0
Re: The dreaded memory leak
« Reply #19 on: Sep 03, 2010; 11:58 PM »
The odd thing is, it stops leaking at about 5.2gb after running for a couple of hours and visiting a lot of maps at 64bit. My guess is that you're safe with 5.2gb + whatever your system uses in idle combined as pagefile and ram. While running at 32 I recall a memory usage cap at 2gb which requires the game to recycle memory much more frequently possibly causing the crashes. I'm not entirely sure though since I'm running on 12gb ram.

Alaisiagae

  • Nameless
  • *
  • Posts: 47
  • Karma: 0
Re: The dreaded memory leak
« Reply #20 on: Sep 04, 2010; 09:31 PM »
What are the signs of a memory leak? I know what it looked like on that one level in NWN: SotU where the game would get slower and slower and start getting 1/4 frames per second. Is that what it'd look like if HG had a leak?

So far, I have not encountered a similar phenomenon while playing Hellgate Revival, nor has the game ever crashed on me. Windows XP 64-bit with SP2 and 3GB of RAM.

The only thing that I've noticed is that the game seems to tie up my system resources for several minutes after I quit the game. If I try to open Firefox, it'll just take about three or four times longer than usual. Even trying to access Windows Explorer is slow.

Kite

  • Developer
  • Eldest
  • ****
  • Posts: 1095
  • Karma: 3
Re: The dreaded memory leak
« Reply #21 on: Sep 04, 2010; 10:03 PM »
Slow-downs are very common when you don't have enough RAM and the system has to use its virtual memory... not necessarily a sign of memory leak.
The most noticable effect of a memory leak is that the game will consume your memory, but won't free it anymore... that way the game will hog more and more memory until there's none left. The result is a game crash without anything you can do...

@Hellgate still using up resources after shutting down:
This MIGHT point towards a memory leak, but then again HGL always had various kinds of problems... As long as the ressources are released after a while, everything is fine. Otherwise you can always force-quit HGL via the task manager.
~ Recettear ~
Capitalism, ho!

Alaisiagae

  • Nameless
  • *
  • Posts: 47
  • Karma: 0
Re: The dreaded memory leak
« Reply #22 on: Sep 05, 2010; 08:30 PM »
Quote from: "Kite"
@Hellgate still using up resources after shutting down:
This MIGHT point towards a memory leak, but then again HGL always had various kinds of problems... As long as the ressources are released after a while, everything is fine. Otherwise you can always force-quit HGL via the task manager.
Interesting. I have the freeware program "FreeRAM XP Pro" which forces freeing-up of RAM. I can do it manually, but I can also have it running in the background and having it do such a thing at either time intervals and/or when remaining available RAM reaches a specific amount.

Is there a way to get HG to show me framerate? I might dabble with testing how performance is affected with FreeRAM active. But, given how I've not really had any problems, it isn't too high on my priority list.

Is the memory leak affected by how high I set the game settings? In other words, is there more of a leak if I increase the graphics settings (AA, AF, shadows, lights, etc)? Just curious, is all. The game automatically picked some very high settings, but I felt I had to turn them down a bit to get a framerate I liked (probably something like 50-70fps is what I like). I can imagine how higher settings would use more RAM... and logically I would think such a thing would not affect whether a memory leak strikes or not... but I know game engines can do the darndest things that defy all common sense and logic.

I also notice that HG is pretty slow to start up. Well, what I mean is, when I load a game, it takes it a bit to render the area my character is in: the textures take a few seconds to pop up, sometimes the NPC models take a moment to be visible (though their weapons are visible, so it is rather amusing to see a rifle floating as an un-rendered Hunter Guard patrols a station). Is that normal? The game gets better after about a minute or two.

Kite

  • Developer
  • Eldest
  • ****
  • Posts: 1095
  • Karma: 3
Re: The dreaded memory leak
« Reply #23 on: Sep 05, 2010; 09:09 PM »
@Framerate:
Open the "chat" box and type in "/fps" to enable/disable the framerate display (sometimes freezes when warping, just disable/enable it again)

@Memory leak & high settings:
When you use high graphic settings the game will automatically switch to higher resoluton textures and do other stuff, so yeah, it should increase the amount of memory that is used by the game...

@Long loading times:
Depending on your graphic settings the game takes some time to load all the needed resources so it might take a while and cause such a strange behaviour.
~ Recettear ~
Capitalism, ho!

FourthHostage

  • Nameless
  • *
  • Posts: 8
  • Karma: 0
Re: The dreaded memory leak
« Reply #24 on: Sep 14, 2010; 02:27 AM »
This thread was incredibly usefull, thanks.

thumper

  • Guest
Re: The dreaded memory leak
« Reply #25 on: Sep 14, 2010; 03:58 AM »
Quote from: "Kite"
@Framerate:
Open the "chat" box and type in "/fps" to enable/disable the framerate display (sometimes freezes when warping, just disable/enable it again)

Thanks Kite, I knew there was a way to show this, just couldn't remember the command...

Now, what would be a "good" framerate, with DX10, max settings, etc etc... has anyone posted their SP findings to your knowledge?

SilentGreen

  • Nameless
  • *
  • Posts: 13
  • Karma: 0
Re: The dreaded memory leak
« Reply #26 on: Sep 14, 2010; 07:56 PM »
@topic

I've experienced infinite loading screens and CTD's during gameplay. In my case it was fixed by restarting the game and keep the taskmanager open / running in the background. Additional it works, if the taskmanager is launched, before HG:L itself. I'm using Windows XP, 32bit and an GF8800GT with 512Mb vram, total ram 4Gb (~3,2Gb). Game is set to DX9. No idea why the taskmanager is necessary for the game to run properly, but well... as long as it works <.<

Maybe the driver for the 8800 is a problem? Wasn't upgraded for years :X xD

Wildman

  • Founder
  • Eldest
  • ****
  • Posts: 1036
  • Karma: 9
  • Mental Case
Re: The dreaded memory leak
« Reply #27 on: Sep 15, 2010; 02:26 AM »
Thats the memory leak, if you adjust your page file/virtual memory as posted in the OP, it should help and updating your graphics drivers cant hurt. 32bit OS's only read about 3.2Gb as you know, which is why I believe 64bit OS's with 4gig or more memory dont suffer from the leak as badly. If you have a way to monitor your memory you'll see that when it reaches 80+% the game slows down and is about to CTD.
All is cloaked in darkness and the darkness is my home. I shun the light but still I fight, until the dark is safe once again.

SilentGreen

  • Nameless
  • *
  • Posts: 13
  • Karma: 0
Re: The dreaded memory leak
« Reply #28 on: Sep 15, 2010; 07:07 PM »
Hmm fine. Damn memory-leak xD
I will check the settings of my vmem and set them to the values suggested by you.
That the memory-leak exists and is responsible for the crashes was already known to me, as well as increasing the vmem could solve this problem. But an explicit suggestion which size the vmem should have, was hard to find. Thank you for this!

Only thing that confuse me: why prevent XP's taskmanager HG:L from crashing? <.<

Greetings

Wildman

  • Founder
  • Eldest
  • ****
  • Posts: 1036
  • Karma: 9
  • Mental Case
Re: The dreaded memory leak
« Reply #29 on: Sep 16, 2010; 09:15 PM »
Dont hold me to this, but the reason the game doesn't crash when the task manager is running maybe because the TM is reallocating memory or it might be restricting other processes access to the memory while HG:L is running, which in a sense would be like giving HG:L the highest priority for memory usage.

It is possible that I'm wrong, it's just a theory.
All is cloaked in darkness and the darkness is my home. I shun the light but still I fight, until the dark is safe once again.