Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Dirty Exit.  (Read 13151 times)

Nivim

  • Bay Watcher
  • Has the asylum forgotten? Are they still the same?
    • View Profile
Dirty Exit.
« on: June 04, 2009, 07:45:03 pm »

 I am not sure how much of a bug this is, or if it simply wasn't done. But Dwarf Fortress does not close cleanly, it slows down the computer afterwards and causes minor interference with other programs. I am guessing either Toady was too lazy to go through the trouble of programming a clean exit, or he is waiting for when the game is at version 1.0 so he wont have to mess with it too much.
Logged
Imagine a cool peice of sky-blue and milk-white marble about 3cm by 2cm and by 0.5cm, containing a tiny 2mm malacolite crystal. Now imagine the miles of metamorphic rock it's embedded in that no pick or chisel will ever touch. Then, imagine that those miles will melt back into their mantle long before any telescope even refracts an image of their planet. The watchers will be so excited to have that image too.

ToonyMan

  • Bay Watcher
  • Danger Magnet
    • View Profile
Re: Dirty Exit.
« Reply #1 on: June 04, 2009, 07:46:11 pm »

What do you mean?  I don't experience any problems with shutting down DF.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Dirty Exit.
« Reply #2 on: June 04, 2009, 08:22:22 pm »

Are you using a non-Windows version?  The Windows version works just fine for me, but maybe the Mac version leaves cruft lying around due to inexperience with that platform, say.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Derakon

  • Bay Watcher
    • View Profile
Re: Dirty Exit.
« Reply #3 on: June 04, 2009, 09:38:57 pm »

I'm on a Mac and I've not noticed any problems post-shutdown. To my knowledge, it shouldn't be possible to continue using resources after program exit unless you've made child processes and then not forced them to exit; Dwarf Fortress doesn't make child processes, so it can't leave effects behind after it's done.

Perhaps you're noticing a temporary slowdown as the memory Dwarf Fortress was using is freed and other programs start paging stuff in from the disk? How long does your slowdown last? And please tell us what operating system you're using and your computer specs.
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Nivim

  • Bay Watcher
  • Has the asylum forgotten? Are they still the same?
    • View Profile
Re: Dirty Exit.
« Reply #4 on: June 05, 2009, 01:27:06 pm »

 It's the same effect most programs in existence have and goes away when you restart the computer. It isn't that much, around 5 fps hit for most things. A common problem, and it isn't specific to an operating system or computer setup (it's a Windows XP with run-of-the-mill decent processor and graphics card anyway). I was just pointing it out and to ensure that Toady would take care of it at some point.
Logged
Imagine a cool peice of sky-blue and milk-white marble about 3cm by 2cm and by 0.5cm, containing a tiny 2mm malacolite crystal. Now imagine the miles of metamorphic rock it's embedded in that no pick or chisel will ever touch. Then, imagine that those miles will melt back into their mantle long before any telescope even refracts an image of their planet. The watchers will be so excited to have that image too.

Keiseth

  • Bay Watcher
    • View Profile
Re: Dirty Exit.
« Reply #5 on: June 05, 2009, 02:58:28 pm »

I honestly have no idea what you speak of. I've started and closed DF hundreds of times while working on modded races and I have felt no ill effects- and my computer is slow enough that even the smallest decrease in efficiency would be instantly noticeable.

I was thinking you were referring to some sort of memory leak, but that would be resolved when the process ended (as I've made a huge memory leak before and it was gone by simply closing the program for good.)

Might it be a problem specifically with your computer or operating system?
Logged

eerr

  • Bay Watcher
    • View Profile
Re: Dirty Exit.
« Reply #6 on: June 05, 2009, 04:23:39 pm »

Is it version 40d11?
I believe that one might be double-threaded now.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Dirty Exit.
« Reply #7 on: June 05, 2009, 06:10:50 pm »

It's the same effect most programs in existence have and goes away when you restart the computer. It isn't that much, around 5 fps hit for most things. A common problem, and it isn't specific to an operating system or computer setup (it's a Windows XP with run-of-the-mill decent processor and graphics card anyway). I was just pointing it out and to ensure that Toady would take care of it at some point.

I also have no idea what you're talking about.  And no offense but if you say "most programs" have this problem, you're wrong.  This sounds like something wrong with your computer.  Maybe you've got very low RAM, and you're actually seeing paging issues?
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Corona688

  • Bay Watcher
    • View Profile
Re: Dirty Exit.
« Reply #8 on: June 05, 2009, 06:31:58 pm »

Not many programs churn through memory the way DF does.  Lots of things consume lots of memory, but DF actually uses most of what it has fairly often.  I wonder if its memory fragmentation...  Not much else would cause nonspecific performance issues after a program quits.  Except paging, and if it was that, I'm pretty sure you'd know :p
« Last Edit: June 05, 2009, 06:38:06 pm by Corona688 »
Logged
You never know when you might need a berserk dwarf to set loose somewhere.

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Dirty Exit.
« Reply #9 on: June 06, 2009, 05:47:02 pm »

I am guessing either Toady was too lazy to go through the trouble of programming a clean exit, or he is waiting for when the game is at version 1.0 so he wont have to mess with it too much.
No.
Toady's exit code is fine.
There's a couple of reasons this could be:
If you did any memory editing and/or it crashes, it might not close cleanly.
Check for the process still running after exit.

Memory fragmentation - Free bits in the memory in non-sequential areas are taken by the same program.
Very similar to fragmentation of hard drives, but resolved by a simple restart, as RAM clears when it loses power.

If "most programs in existence" cause it, it's clearly not exclusive to DF, and it's clearly not a DF bug.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: Dirty Exit.
« Reply #10 on: June 08, 2009, 03:02:11 pm »

Is it version 40d11?
I believe that one might be double-threaded now.
All threads die on process exit. That's kind of the point of threads: to not go outside the process space.
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

Dant

  • Bay Watcher
    • View Profile
Re: Dirty Exit.
« Reply #11 on: June 09, 2009, 05:16:01 am »

if ur on windows theres a flag on the registry that u have to set otherwise windows wont unload the dlls the program required

hkey_local_machine->software->microsoft->windows->explorer, if it doesnt have a AlwaysUnloadDll key create it and set the standard value to 1

thats an old windows trick but most ppl never heard of it
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Dirty Exit.
« Reply #12 on: June 09, 2009, 10:17:17 am »

if ur on windows theres a flag on the registry that u have to set otherwise windows wont unload the dlls the program required

hkey_local_machine->software->microsoft->windows->explorer, if it doesnt have a AlwaysUnloadDll key create it and set the standard value to 1

thats an old windows trick but most ppl never heard of it
That key is moot with Vista/7, as it automatically unloads unused DLLs.
Perfectly valid with XP or lower.

However, the number of DLLs that DF loads is not even close to capable of causing a 5 FPS drop in anything.
I see roughly 5MB of DLLs.  If losing 5MB of RAM is causing a 5 FPS drop, I think you need more RAM.
« Last Edit: June 09, 2009, 10:21:41 am by jaybud4 »
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: Dirty Exit.
« Reply #13 on: June 09, 2009, 09:25:39 pm »

if ur on windows theres a flag on the registry that u have to set otherwise windows wont unload the dlls the program required
Please spell out the words.  "ur" just sounds clumsy in my head.

Anyway, DF is not and never will be double-threaded.  I'm fairly certain Toady said this himself.  I'm given to understand he would have to rework the program quite extensively for that to work.  Even so, I am 100% positive that 40d11 isn't double threaded.  So it's not even possible for it to be a problem with double-threading.  My guess is just poor RAM.  DF doesn't cause problems for me when closing, and I have RAM on my computer that is really in need of upgrading.
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

SHAD0Wdump

  • Bay Watcher
  • Hiding in SPAAACE!!!
    • View Profile
Re: Dirty Exit.
« Reply #14 on: June 10, 2009, 05:35:43 am »

I wonder if its memory fragmentation...
I think I remember hearing somewhere else on this site about that,someone said that DF fragments horridly.

I have no experience with programming,I'm just telling you what I remember sounded bad.
Logged
Pages: [1] 2