Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: using more ram?  (Read 1788 times)

justicarab

  • Bay Watcher
    • View Profile
using more ram?
« on: December 19, 2014, 02:08:32 pm »

i heard of a thirdparty utility that lets me allow df to use more than 2gigs of ram, any1 know?
Logged
This forum is the most helpful and polite i have ever seen. always happy to help my many post and to you all i say thank you so much for making me feel welcomed!

bluephoenix

  • Bay Watcher
    • View Profile
Re: using more ram?
« Reply #1 on: December 19, 2014, 04:59:43 pm »

It is called "large address aware".
It lets DF use up to 4 GB of ram. It lets you use larger worlds and larger embarks, it also somehow solves a few crashes on regular embarks.

You simple use the program on the DF exe once.
Logged

justicarab

  • Bay Watcher
    • View Profile
Re: using more ram?
« Reply #2 on: December 19, 2014, 05:13:47 pm »

thank you for the reply, the file just came with df.exe in a legacy and sdl folder and it says i'm missing a file. do i place the file in my df folder?

sorry, i got it, but it didn't seem to help with in game fps though :{
« Last Edit: December 19, 2014, 05:24:17 pm by justicarab »
Logged
This forum is the most helpful and polite i have ever seen. always happy to help my many post and to you all i say thank you so much for making me feel welcomed!

mndfreeze

  • Bay Watcher
    • View Profile
Re: using more ram?
« Reply #3 on: December 20, 2014, 01:41:35 am »

It is only for systems that are running a 32 bit OS right?
Logged

bluephoenix

  • Bay Watcher
    • View Profile
Re: using more ram?
« Reply #4 on: December 20, 2014, 03:39:16 am »

No it is for systems that are 64 bit and you need at least 4 gb of ram in your computer.
It doesn't help FPS, it simply prevents crashes when DF tries to use more than 2 GB of ram.
Logged

mndfreeze

  • Bay Watcher
    • View Profile
Re: using more ram?
« Reply #5 on: December 20, 2014, 07:46:42 am »

Yeah my bad, I totally misread the techpowerup page somehow.

for 32 bit proggies on either 32 bit or 64 bit OS's, but 32 bit OS's need to have some other stuff enabled/changed so THEY can use more then 2G properly first.

I might need to try this later even though I do small embarks, I wonder if it will assist in adventure mode crashing.
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: using more ram?
« Reply #6 on: December 21, 2014, 06:24:28 am »

Note that it is also specifically for Windows 64-bit. OSX and Linux both allow programs to use as much memory as they want and have for a long time now, it's just Windows that has problems there. (Though to be fair OSX and Linux 32-bit versions could certainly run into problems with memory at times, they just didn't bother to put in the safety stuff that is now getting in the road :P).
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Cruxador

  • Bay Watcher
    • View Profile
Re: using more ram?
« Reply #7 on: December 21, 2014, 08:36:45 am »

Peter Jackson saw this thread title before filming his new movie and got the wrong idea entirely. Not even the right kind of ram.
Logged

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: using more ram?
« Reply #8 on: December 21, 2014, 12:16:15 pm »

Note that it is also specifically for Windows 64-bit. OSX and Linux both allow programs to use as much memory as they want and have for a long time now, it's just Windows that has problems there. (Though to be fair OSX and Linux 32-bit versions could certainly run into problems with memory at times, they just didn't bother to put in the safety stuff that is now getting in the road :P).

Linux 32bit uses PAE to get processes with bigger than 4gb memory space size. This limitation is hardware specific, as the CPU's address bus is only 32bits wide on a 32bit processor (hence, 32bits!) which gives a maximum addressable size of 4gb.  Using PAE, some shuffling can happen to get virtual address spaces above 32bits in size, but this still wont solve problems internal to DF that make use of unsigned longs, which on a 32bit system are going to be 32bits long. Changing the size of all unsigned longs is going to have a non-trivial impact on memory structure alignment and other fun stuff.

So, while windows has a silly 2gb restriction for a 32bit process (to reserve memory address space for virtual addresses), and linux does not, this does not mean DF can allocate more than 4gb of RAM before crashing-- on either system. :D
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: using more ram?
« Reply #9 on: December 21, 2014, 01:47:23 pm »

Yeah, my point was that 64-bit Linux and Mac should be able to go over 4 GB without needing any changes to the DF program (unlike 64-bit windows, which requires you to modify the DF executable before it will let you). I was not intending to imply that 32-bit OS's would let you give over 4 GB without problems, sorry if you got that. :P

Also I'm pretty sure that this has been bundled up into the main DF Hack package at this point for Windows, so you might want to check there.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: using more ram?
« Reply #10 on: December 22, 2014, 09:45:07 am »

Yeah, my point was that 64-bit Linux and Mac should be able to go over 4 GB without needing any changes to the DF program (unlike 64-bit windows, which requires you to modify the DF executable before it will let you). I was not intending to imply that 32-bit OS's would let you give over 4 GB without problems, sorry if you got that. :P

Also wrong! A 32-bit program cannot use more than 4GB of ram, ever. Under any circumstances! **
The reason is that a 32-bit program uses 32-bit addresses, which means it can uniquely address at most 2^32 = 4G addresses. Modern computers are byte-addressed, so that becomes 4GB. The difference between linux and windows versions of DF is whether you can use >2GB without setting the LAA flag, 4GB is a hard limit in both cases that you can't circumvent.
** I won't mention AWE, as that requires the program to be written specially to use it

Also for those it interests, Windows requires a program to be flagged as supporting up to 4GB of ram (well "4G of virtual addresses", technically) for compatibility reasons. Prior to PCs having anywhere near gigabytes of ram, the 32-bit Windows virtual address space was divided in half (2GB each for user and system) for simplicity. Both sides had more address space available than ram in the machine by at least an order of magnitude, so it was fine! Unfortunately some developers saved themselves some ram by shrinking their program's addresses to 31 bits (2GB, which was all the program could use anyway) and using the extra bit for whatever 1-bit flag they needed to store. This invisibly makes the program incapable of using 4GB, even if allowed to by the OS. In fact, allowing it access to 4GB will most likely cause it to crash! Microsoft prides compatibility more than the linux community, so rather than have existing programs crash everywhere they made it so developers who didn't pull tricks like this could mark their programs as "Large Address Aware" and use 4GB of ram, and older programs (which were theoretically designed for 2GB and less ram use anyway) would be fine continuing to be limited to 2GB.

3rd-party software that can set the LAA flag exist purely for when the developer doesn't do it themselves, it should really be the default for all new software.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.