PDA

View Full Version : Mermory use improvement for 64bit systems



thefruitbat
12-13-2009, 09:46 AM
Hi all, this is a utility i saw over at SAS, and after checking with a moderator here, to check all is within forum rules and with Cirx's permission, i am reproducing the post, and hosting the program here.


G'Day, first post.

http://www.whatwalrus.com/sas2/cirx/miscpix/4gb_patch.jpg

For guys who have 64bit Operating Systems

You might want to check out this little program at. It modifies an exe file to allow 32 bit apps (eg IL2) to access 4GB of virtual memory on 64bit systems. I used it to modify il2fb.exe in UP1.8. Resolved issues I had with stuttering and game freezing after 30 - 40 mins on some maps. Running Windows 7 Ultimate 64bit, 4GB RAM.



Form the original Website:

<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content"> I originally wrote this tool for a friend of mine who needed it. This very little tool patches x86 executables in order to let them have 4GB (instead of only 2) of virtual memory on x64 platforms. This tool comes very handy for applications which need a great amount of virtual memory like games, 3D renderization, multimedia etc. To gain these 2GB, you just have to use this tool to patch the executable (*.exe file) of the software you want to have these additional GBs of virtual memory. It can be used by clicking on it and choosing the file or through command line (e.g.: "4gb_patch file.exe"). It automatically creates a backup copy of the original executable.

Why things are this way on x64 is easy to explain. On x86 applications have 2GB of virtual memory out of 4GB (the other 2GB are reserved for the system). On x64 these two other GB can now be accessed by 32bit applications. In order to achieve this, a flag has to be set in the file's internal format. This is, of course, very easy for insiders who do it every day with the CFF Explorer. This tool was written because not everybody is an insider, and most probably a lot of people don't even know that this can be achieved. Even I wouldn't have written this tool if someone didn't explicitly ask me to


This tool was made by Daniel Pistelli

Cheers,
vegetatrian


Post edited by CirX </div></BLOCKQUOTE>

Link: http://www.mediafire.com/?1dqnenkdc0i

I have tried this on both my stock 4.09 and hsfx4.1 install, running vista 64 6gig ram, and now for the first time i can run cannon's channel map without any texture compression, without getting memory errors.

Personally, if you've got a 64bit system with 4 gig or more...

Thanks again to Vegetarian and CirX,

cheers fruitbat

thefruitbat
12-13-2009, 09:46 AM
Hi all, this is a utility i saw over at SAS, and after checking with a moderator here, to check all is within forum rules and with Cirx's permission, i am reproducing the post, and hosting the program here.

<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content"> G'Day, first post.

http://www.whatwalrus.com/sas2/cirx/miscpix/4gb_patch.jpg

For guys who have 64bit Operating Systems

You might want to check out this little program at. It modifies an exe file to allow 32 bit apps (eg IL2) to access 4GB of virtual memory on 64bit systems. I used it to modify il2fb.exe in UP1.8. Resolved issues I had with stuttering and game freezing after 30 - 40 mins on some maps. Running Windows 7 Ultimate 64bit, 4GB RAM.



Form the original Website:

<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content"> I originally wrote this tool for a friend of mine who needed it. This very little tool patches x86 executables in order to let them have 4GB (instead of only 2) of virtual memory on x64 platforms. This tool comes very handy for applications which need a great amount of virtual memory like games, 3D renderization, multimedia etc. To gain these 2GB, you just have to use this tool to patch the executable (*.exe file) of the software you want to have these additional GBs of virtual memory. It can be used by clicking on it and choosing the file or through command line (e.g.: "4gb_patch file.exe"). It automatically creates a backup copy of the original executable.

Why things are this way on x64 is easy to explain. On x86 applications have 2GB of virtual memory out of 4GB (the other 2GB are reserved for the system). On x64 these two other GB can now be accessed by 32bit applications. In order to achieve this, a flag has to be set in the file's internal format. This is, of course, very easy for insiders who do it every day with the CFF Explorer. This tool was written because not everybody is an insider, and most probably a lot of people don't even know that this can be achieved. Even I wouldn't have written this tool if someone didn't explicitly ask me to


This tool was made by Daniel Pistelli

Cheers,
vegetatrian
</div></BLOCKQUOTE>

Post edited by CirX </div></BLOCKQUOTE>

Link: http://www.mediafire.com/?1dqnenkdc0i

I have tried this on both my stock 4.09 and hsfx4.1 install, running vista 64 6gig ram, and now for the first time i can run cannon's channel map without any texture compression, without getting memory errors.

Personally, if you've got a 64bit system with 4 gig or more...

Thanks again to Vegetarian and CirX,

cheers fruitbat

WhiteSnake_76
12-13-2009, 10:23 AM
if it would only affect an install of IL2 i would have given it a try and checked memory use.

But because i understand from this text it affects all 32 bit aplications personaly its to risky for me,
I was/am under the impresion that Windows Vista 64 bit and Windows 7 64 bit already let a 32 bit aplication use more than 2GB of RAM unlike XP 64 bit wich i know doesnt.

thefruitbat
12-13-2009, 10:34 AM
it only patches the exe's you choose, ie the il2fb.exe.

I just copied the il2fb.exe on to my desktop, ran the utility which was on my desktop, it asks you to select an exe, point it at the il2fb.exe, and it patches it, and creates a backup of the original. then just move the patched il2fb.exe back in to il2install folder, and create a shorcut from that.

doesn't affect anything else...

WhiteSnake_76
12-13-2009, 10:48 AM
ah, alright than, so it probably only works with older games that have some kind of limit set in there exe.file than.

I might give it a try later than on a moded install to see what it does to memory use.

mortoma
12-13-2009, 10:49 AM
I don't think that IL2 usually needs much more than 1.5GB no matter what map you are running. And if you have a video card with 1GB of VDRAM a lot of the textures for big maps will end up getting loaded into the VDRAM anyway. I'm not absolutely sure about that, don't claim to be an expert but this is from my experience. I do know that a few of the mod maps and maps that came out with 4.09b1 and 4.09m are indeed memory hogs though.

thefruitbat
12-13-2009, 10:55 AM
I'd be interested to see the results.

What i do know, is that before i tried this, i had to turn texture compression on to 2 in the config to run cannons final channel map with no errors, either missions wouldn't start with the paratrooper error, or graphical errors would start showing up. Since using it i can turn off texture compression again, something that really bugged me.

fruitbat

WhiteSnake_76
12-13-2009, 04:49 PM
I dont see any difrence without or with this "patch" aplied to the IL2FB exe, game stays at about 1.2~1.5GB memory use.
Tested with the Black Death track btw.

thefruitbat
12-13-2009, 05:18 PM
Running black death,

http://i7.photobucket.com/albums/y290/thefruitbat1/ScreenHunter_03Dec140011-Copy.jpg

Running a 1 v1 trk i made on cannons channel map,

http://i7.photobucket.com/albums/y290/thefruitbat1/ScreenHunter_04Dec140012-Copy.jpg

2.41 vs 3.18 Gb's used. I'm guessing this extra is whats letting me run this map without texture compression now.

Edit, same track, but without patch applied,

http://i7.photobucket.com/albums/y290/thefruitbat1/ScreenHunter_06Dec140035.jpg

Only 2.55 being used as opposesed to 3.18.

arjisme
12-13-2009, 07:09 PM
You have 8 CPUs?

Treetop64
12-13-2009, 08:31 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by ar****e:
You have 8 CPUs? </div></BLOCKQUOTE>

It's a 4-core with Hyperthreading.

The system kernel queues for eight logical cores while the four physical cores execute. Useful if the data in the register is waiting, but "cache thrashing" becomes a risk, especially if you're running minimal RAM.

WhiteSnake_76
12-13-2009, 10:34 PM
@thefruitbat:

I got the same results as you on the Black Death Track, with ot with out it made no difrence there.

Probably needs a heavier map than indeed.

p.s. i notice theres difrences in the load on the cores also from your screens.

SeaFireLIV
12-14-2009, 09:22 AM
You should try the Leningrad map. That used to always quit on me after about 20-40 minutes or so. Berlin city centre is possible too, though it just slowed down. Nothing fixed it. Maybe i`ll test myself.

thefruitbat
12-14-2009, 10:16 AM
Since the game was written with this 2gig limit in mind, i would suspect that most of the stock maps will be well within. As seafire points out, leningrad and berlin are probally the ones to test it on, as they used to really push systems back in the day.

I would think this must be of some benifit to those running servers though, whatever the map.

Later on, i'll turn off hyperthreading, allocate il2 to one core and play a mission windowed out of 'fighter boys'. Its on cannons map and has about 90 planes, should be interesting to see what it gets up to during that.

It definatly does what it says though, its a keeper for me.

@NDS_Camp, the reason the core load is like that, is because i've set Processer afinity to 255, to let il2 use all 8 cores to see if there was any difference. there isn't.

fruitbat