Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [39c] Dwarf Fortress doesn't deallocate memory after saving  (Read 797 times)

Qmarx

  • Bay Watcher
  • "?"
    • View Profile

Just did a little comparison...

When you first get to the main menu after starting up dwarfort.exe the program takes up about 13 mb of RAM (13,712 kb according to task manager).  I played a while on the game, then saved and returned to the main menu.  Once there, I checked the memory usage again.  This time it was 52 mb.

Having noticed this, I decided to do another test.  Cycling in and out of the "create new world with parameters" window increases the memory use slowly but steadily.

I know optimization is a little later, but this might explain why DF keeps locking up my system - I save often when playing, and it might keep inflating the memory requirements.
« Last Edit: July 20, 2008, 04:30:05 pm by Qmarx »
Logged

grelphy

  • Bay Watcher
    • View Profile
Re: [39c] Dwarf Fortress doesn't deallocate memory after saving
« Reply #1 on: July 20, 2008, 07:48:54 pm »

As a quick fix, try setting [AUTOSAVE:SEASONAL] and maybe [AUTOBACKUP:ON] in the init. That'll save you from cycling in and out of the menu when saving.
Logged
Given the general shape of coins and what most people seem to find the minted variety useful for: "Rounds".

Qmarx

  • Bay Watcher
  • "?"
    • View Profile
Re: [39c] Dwarf Fortress doesn't deallocate memory after saving
« Reply #2 on: July 20, 2008, 09:23:12 pm »

Yeah, I'm doing that.  It helps a little...

My computer might be a little borderline for DF.  I get reduced, but not nonexistent crashing with fewer other programs running.  Winamp guarantees a crash within a couple of hours, and 3dwarf will cause one within minutes if I'm running them simultaneously with DF.  It's possible that my computer just can't handle the program.  When my computer freezes up, the CPU is working like crazy - which I suppose could mean that there's an infinite loop somewhere.

Anyway, I'm on a R52 thinkpad, so my specs are Intel Pentium 2GHz 798MHz, with 1GB of RAM.  Maybe this isn't good enough (although the framerates on the fortresses I'm currently using are around 70-90)
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: [39c] Dwarf Fortress doesn't deallocate memory after saving
« Reply #3 on: July 21, 2008, 01:29:25 am »

There were well could be memory leaks, but I cycled out of the gen screen 20 times and didn't get a gradual increase.  There's a one time increase (for me from ~13 to 34 MB) at the title screen because it doesn't clean the first mess until you select an option, but after that it hung around at 34 MB permanently.  My leak detector VLD doesn't find anything (and it has been very observant in the past) when I load and save a game, but that game might not have the exact feature that's causing a problem if there is one.  If somebody has a save, or some DF sequence of commands, that they suspect isn't cleaning itself properly, I can take a look at it.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Qmarx

  • Bay Watcher
  • "?"
    • View Profile
Re: [39c] Dwarf Fortress doesn't deallocate memory after saving
« Reply #4 on: July 21, 2008, 10:02:56 am »

There were well could be memory leaks, but I cycled out of the gen screen 20 times and didn't get a gradual increase.  There's a one time increase (for me from ~13 to 34 MB) at the title screen because it doesn't clean the first mess until you select an option, but after that it hung around at 34 MB permanently.  My leak detector VLD doesn't find anything (and it has been very observant in the past) when I load and save a game, but that game might not have the exact feature that's causing a problem if there is one.  If somebody has a save, or some DF sequence of commands, that they suspect isn't cleaning itself properly, I can take a look at it.
I'm beginning to suspect that my computer's just screwed up.  It's doing similar things to an older one I had, and that one turned out to have a slightly defective stick of RAM. 

I'll stick to bugs that aren't random crashes/freezes from now on, in order to avoid wasting your time on quirks of my own system (sorry).
« Last Edit: July 23, 2008, 09:22:21 pm by Qmarx »
Logged