Jump to content
fred41

using large page memory mapping, for increased performance

Recommended Posts

Fred is coolest :) Fred is life :)

Fred is love, Fred is life.

Edit: Ah crap I forgot what I was going to say:

Erm, it definitely feels smoother, though the average fps only increased by one frame per second in my personal benchmark (not much, just placing yourself as an armed civilian while all of the TPW mods are active and running 100% in a random settlement in Altis).

Edited by 13isLucky

Share this post


Link to post
Share on other sites
I have some (very individual) numbers, if this increase your guys motivation to test it.

i5/2500k/4GHz

16GB/1600Mhz/9-9-9-24

win7/64bit

Viewdistance 1600, textures high, e.t.c.

'Helos A3 Benchmark' (modified to get 0.1FPS resolution, loaded and saved in editor for each new arma build)

each test with 3 averaged runs/results, arma fully restarted for each test

results:avg/max

73.5/74.2 vanilla

78.1/79.3 GMF

82.1/84.1 GMF + tbbmalloc (LP)

Don't blame me if you get other numbers, this can have many reasons.

Greets,

Fred41

Can you give information how to test with tbbmalloc (LP)? :p

I watched github and tried to download but zips were passworded.

Share this post


Link to post
Share on other sites

  1. No real increase in framerate (expected)
  2. Game does not slow down as much when vehicle explodes in front of me (more free memory to handle particles maybe)
  3. Game is noticably smoother when panning about with the camera/flying
  4. Lots of AI in the scene still slow the game (I never expected a memory tweak to make this better though).

This is my experience of this tweak too. No discernibly moar FPS, but FPS tanks appear to be less. Gets the Tanky thumbs up.

Share this post


Link to post
Share on other sites

Interesting. Does this work for ARMA 2 also?

Share this post


Link to post
Share on other sites

Read this with interest & tried it.

Seems to break something. After installing & rebooting, I can run Arma3 once only. Then I get Steam hanging when I try to re-run A3:

Description:

A problem caused this program to stop interacting with Windows.

Problem signature:

Problem Event Name: AppHangB1

Application Name: Steam.exe

Application Version: 2.19.72.18

Application Timestamp: 53582759

Hang Signature: 1145

Hang Type: 0

OS Version: 6.1.7601.2.1.0.256.48

Locale ID: 2057

Additional Hang Signature 1: 1145c7e7620bfc5751f5c4bfdc0ec7d2

Additional Hang Signature 2: 32d2

Additional Hang Signature 3: 32d237c56149667d9a4615170f284f33

Additional Hang Signature 4: 1145

Additional Hang Signature 5: 1145c7e7620bfc5751f5c4bfdc0ec7d2

Additional Hang Signature 6: 32d2

Additional Hang Signature 7: 32d237c56149667d9a4615170f284f33

Rebooting makes no difference. I have to reset the DWORD to zero. One thing I notice is that it creates a key

Key Name: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\arma3.exe

Class Name: <NO CLASS>

Last Write Time: 10/05/2014 - 16:02

Value 0

Name: UseLargePages

Type: REG_DWORD

Data: 0

as well as your specified key

Key Name: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\arma3.exe

Class Name: <NO CLASS>

Last Write Time: 10/05/2014 - 13:49

Value 0

Name: UseLargePages

Type: REG_DWORD

Data: 0

I have to set both DWORDs to zero (as shown) before I can run Arma3.

secpol.msc revealed that my own administrator account was already listed under "Lock pages in memory".

Win7 Pro 64 SP1 (fully updated), OS [C:, 1st partition; 70 GB, 31.5 free] & A3 [2nd partition, O:, 46GB, 20GB free] on Samsung 840 Pro 256GB, i7-3770K @ 4.23GHz, 8GB Corsair Vengeance 1600 Mhz (XMP 800MHz x2), ASUS P8Z77-V LX2. Running in windowed mode 1920 x 1170 on a 1920 x 1200 monitor.

No RAM disk. Pagefile set to a fixed 512MB on C: with fixed 11GB on first partiton (80GB, 52GB free) of HDD (1TB WD Caviar Blue) - launching A3 & running Helo's benchmark doesn't seem to require use of the HDD pagefile.

Arma 3 is 1.18 stable. No mods loaded, just A3 & ZEUS (not that I have any current interest in the latter, it's mandatory).

Also tried your tbb malloc, btw - doesn't seem to work at all, no logfile anywhere on the C: drive. Get a worse FPS (61 FPS) using helo's benchmark than with default malloc (66 FPS). Note I was using MSI afterburner both to custom-control the fan, and especially to limit the FPS to 70 max since without it my GigaByte HD7950 runs flat out in the editor, etc. (This makes no difference to the problem of Steam hanging with the large page tweak - that happens with or without Afterburner, or with/without GameBooster).

A3 RPT load line is:

== O:\Arma 3\SteamApps\common\Arma 3\arma3.exe

== "O:\Arma 3\SteamApps\common\Arma 3\arma3.exe" -nosplash -window -cpuCount=4 -exThreads=7 -showScriptErrors -skipintro -malloc=tbbmalloc.dll -mod=

Share this post


Link to post
Share on other sites

+2/3 fps. Static test in Kavala, no AI.

I cannot say if there is less lag, in any case it didn't worse.

Good find, thanks.

Share this post


Link to post
Share on other sites
Can you give information how to test with tbbmalloc (LP)? :p

I watched github and tried to download but zips were passworded.

@St. Jimmy, tbbmalloc related questions should be better asked in the related thread (see servers & administration), but i will make an exeption :)

Since you probably already set the required privilege (for GMF tweak), all you have to do now, is downloading tbbmalloc.dll from my github repo (folder binary) and install it in a3\dll folder.

Then add '-malloc=tbbmalloc' as first parameter in your arma launch command line. Check your mallocxxxx.log file to verify that everything is working.

If you are unsure, post your .log file in the related thread and i will take a look.

Share this post


Link to post
Share on other sites
Garbage. He shared the concerns that people might have using an exe, and so told them how to do it manually.

what gives you the impression that no-one knows how to undo the change? It would be as simple as removing the registry entry. This isn't "messing around" if you know anything about how your PC's OS works. If you don't, you probably shouldn't be reading - or commenting on - this thread.

I mis-read

... this is a very good question ...
and thought it meant he didn't know, but also maybe i don't know how my registry works or how my OS works and it isn't your place to tell me that i shouldn't be reading or commenting this thread. I was respectful, you were a rude.

Share this post


Link to post
Share on other sites
Interesting. Does this work for ARMA 2 also?

I didn't tested it, but i see no reason that it should not. Please test it and let us know.

(if it doesnt work you have to set the registry value 'UseLargePages' back to 0 manuelly via registry editor, see initial post for keyname)

Share this post


Link to post
Share on other sites

Fred you could also slap this into a batch file for people :P

cd C:\downloads
GimmeMoarFrames %UserName%
shutdown -r

Share this post


Link to post
Share on other sites

== O:\Arma 3\SteamApps\common\Arma 3\arma3.exe

== "O:\Arma 3\SteamApps\common\Arma 3\arma3.exe" -nosplash -window -cpuCount=4 -exThreads=7 -showScriptErrors -skipintro -malloc=tbbmalloc.dll -mod=

Related to your attempt to use tbbmalloc:

The first thing i see in your arma launch command line is, that -malloc=tbbmalloc.dll is nearly at the end. My experience is, that the -malloc param only works as one of the first parameters.

So better put at first position and than look in your .rpt file if tbbmalloc is really used.

If you have more tbbmalloc related questions, please ask in the related thread.

Now back to topic.

To have any advantage from GMF tweak, two conditions must be met:

The 'lock pages in memory' privilege have to be set for the useraccount which you use to run arma.

(additional: if this account is member of the administrator group, you have to start arma via 'run as administrator' too)

This can be done via secpol.msc manually, but can be done with my little tool GimmeMoarFrames.exe too.

The second condition is that, a registry key and a DWORD value are created and set correctly.

This can be done, ether with registry editor or with my little tool too.

See initial post for more details.

In any case, if something doesnt work as expected, you just have to make one of the changes reverse and everything is like before.

---------- Post added at 19:33 ---------- Previous post was at 19:29 ----------

Fred you could also slap this into a batch file for people :P

cd C:\downloads
GimmeMoarFrames %UserName%
shutdown -r

... this is a very good idea, but i think it is not a good idea to spoil peoples to much ... ;)

Share this post


Link to post
Share on other sites
Related to your attempt to use tbbmalloc:

The first thing i see in your arma launch command line is, that -malloc=tbbmalloc.dll is nearly at the end. My experience is, that the -malloc param only works as one of the first parameters.

So better put at first position and than look in your .rpt file if tbbmalloc is really used.

If you have more tbbmalloc related questions, please ask in the related thread.

Ah, I didn't know that, thank you. Will retry & post in the correct thread (sorry!)

Now back to topic.

To have any advantage from GMF tweak, two conditions must be met:

The 'lock pages in memory' privilege have to be set for the useraccount which you use to run arma.

(additional: if this account is member of the administrator group, you have to start arma via 'run as administrator' too)

Both the specified registry entry and the secpol settings appear to be correct, as I posted. I don't know why there is a second registry entry, AFAIK I've never added anything that would insert that entry (I note it is not listed in your .reg file).

I run A3 from an admin account (I only play SP). All runs fine without the reg key DWORd set to 1, but if I set it to 1 & reboot Steam hangs. Same hang if I set the other or both registry entries to 1.

Forgot to mention that I had Steam verify the install after the first batch of hangs. No problems reported.

Cheers

Orc

Share this post


Link to post
Share on other sites
Both the specified registry entry and the secpol settings appear to be correct, as I posted. I don't know why there is a second registry entry, AFAIK I've never added anything that would insert that entry (I note it is not listed in your .reg file).

I run A3 from an admin account (I only play SP). All runs fine without the reg key DWORd set to 1, but if I set it to 1 & reboot Steam hangs. Same hang if I set the other or both registry entries to 1.

Forgot to mention that I had Steam verify the install after the first batch of hangs. No problems reported.

Cheers

Orc

The second registry key in wow6432node branch, is a automatically generated copy and don't have to be changed manually.

Did you try to start arma and/or steam, via 'run as administrator'?

Share this post


Link to post
Share on other sites

So are you going to create a batch file for us lazy people?

And finally can you guarantee at least 5 extra FPS? :D

Share this post


Link to post
Share on other sites

New test. Using also the provided mem allocator i'm getting now +5 fps. :D

Share this post


Link to post
Share on other sites
@St. Jimmy, tbbmalloc related questions should be better asked in the related thread (see servers & administration), but i will make an exeption :)

Since you probably already set the required privilege (for GMF tweak), all you have to do now, is downloading tbbmalloc.dll from my github repo (folder binary) and install it in a3\dll folder.

Then add '-malloc=tbbmalloc' as first parameter in your arma launch command line. Check your mallocxxxx.log file to verify that everything is working.

If you are unsure, post your .log file in the related thread and i will take a look.

Thanks!

The great news is that avg fps in Altis benchmark was now 64fps. That's total of 6fps increase! So now the results again from me

58fps vanilla

61fps GMF

64fps GMF + tbbmalloc (LP)

Share this post


Link to post
Share on other sites

ok, added the tbbmalloc-thing, altis bench:

default: 44fps (two runs)

+GMF: 46fps (three runs)

+tbbm: 48fps!!!! (three runs), verified with the mallocxxxx.log file in the arma3 dir.

For every frame I had to push my 3570k 100Mhz. Because I got 44fps with 4,8Ghz, its now as if I beat it to 5,2Ghz wich is impossible still with watercooling.

Many thanks again fred!!!!!! :bounce3:

Edited by JumpingHubert

Share this post


Link to post
Share on other sites
.......

Also tried your tbb malloc, btw - doesn't seem to work at all, no logfile anywhere on the C: drive. Get a worse FPS (61 FPS) using helo's benchmark than with default malloc (66 FPS). Note I was using MSI afterburner both to custom-control the fan, and especially to limit the FPS to 70 max since without it my GigaByte HD7950 runs flat out in the editor, etc. (This makes no difference to the problem of Steam hanging with the large page tweak - that happens with or without Afterburner, or with/without GameBooster).

A3 RPT load line is:

O:\Arma 3\SteamApps\common\Arma 3\arma3.exe

"O:\Arma 3\SteamApps\common\Arma 3\arma3.exe" -nosplash -window -cpuCount=4 -exThreads=7 -showScriptErrors -skipintro -malloc=tbbmalloc.dll -mod=

The problem with tbbmalloc not working is that your parameter is incorrect, you must omit the .dll extension. Corrected, it should be:

"O:\Arma 3\SteamApps\common\Arma 3\arma3.exe" -nosplash -window -cpuCount=4 -exThreads=7 -showScriptErrors -skipintro -malloc=tbbmalloc -mod=

Share this post


Link to post
Share on other sites

Since this thread now also deals with malloc I hope I am allowed to post this question here:

I am a bit confused regarding the development status the different tbbmalloc library versions are in right now. In my default a3\dll directory I can find four different allocator dlls from BIS. If I understand correctly the default one is tbb4malloc_bi.dll, which is already based on Intels version?

How does Fred's version fit into this picture?

----

I have just tested Fred's tbbmalloc with and without huge pages enabled:

According to the malloc logfile the times spent for memory allocation seem to be significantly longer with huge pages enabled than without? Or am I simply misinterpreting the logfile?

With huge pages:

WindowsVersion: 6.1  ServicePack: 1.0  Typ: Desktop

process virt. address available:  3942
system physical RAM total:        8175
system physical RAM available:    5477
system committed limit:          16348
system committed peak:            6982
system committed current:         3057
system cache current:             2323
system handles:                  28682
system processes:                   80
system threads:                   1234

system uptime minutes:              58

SeLockMemoryPrivilege: granted, huge pages enabled
....
285.404s: regAllocTotalDur:  166.331ms LOCstat: 33420/35840:93.2% TLSLeft:  2

Without huge pages:

WindowsVersion: 6.1  ServicePack: 1.0  Typ: Desktop

process virt. address available:  3916
system physical RAM total:        8175
system physical RAM available:    5593
system committed limit:          16348
system committed peak:            2960
system committed current:         2915
system cache current:             2020
system handles:                  27480
system processes:                   77
system threads:                   1203

system uptime minutes:              44

SeLockMemoryPrivilege: denied, huge pages disabled
...
638.793s: regAllocTotalDur:    2.172ms LOCstat: 81489/84101:96.9% TLSLeft:  2

Edited by oldy41

Share this post


Link to post
Share on other sites

Well I was sceptical. I'm not anymore.

My Benchmark results (ViewDistance 3500, ObjDistance 3500, ShadowDistance 200):

vanilla:

29,29,30,29 fps

with regtweak:

30,31,31,30 fps

with regtweak and tbbmalloc:

a whopping 34,33,34,33 fps

thats quite an improvement!

Share this post


Link to post
Share on other sites

So we have a an average gain of 4-5 frames in the benchmark, which is great . There must be something BI could do to implent this for every user.

Edited by Nikiforos

Share this post


Link to post
Share on other sites
The problem with tbbmalloc not working is that your parameter is incorrect, you must omit the .dll extension. Corrected, it should be:

"O:\Arma 3\SteamApps\common\Arma 3\arma3.exe" -nosplash -window -cpuCount=4 -exThreads=7 -showScriptErrors -skipintro -malloc=tbbmalloc -mod=

@TonyGrant, thanks for correcting me, i didn't see the '.dll' was wrong

---------- Post added at 16:38 ---------- Previous post was at 16:33 ----------

@Inch, @VanZant, @St.Jimmy, &nomisum, thanks for testing and feedback!

I think, it is good to know, that the best things in live are still free :)

---------- Post added at 16:44 ---------- Previous post was at 16:38 ----------

Since this thread now also deals with malloc I hope I am allowed to post this question here:

Please understand that i can't support tbbmalloc in detail here too. This would result in additional confusion and i think we have already enough here.

http://forums.bistudio.com/showthread.php?163640-Arma3-and-the-LARGEADDRESSAWARE-flag-%28memory-allocation-gt-2GB%29

---------- Post added at 16:49 ---------- Previous post was at 16:44 ----------

So we have a an average gain of 4-5 frames in the benchmark, which is great . There must be something BI could do to implent this for every user.

@Nikiforos, indeed, this would be great. At least as easy to use option. So let us see.

Share this post


Link to post
Share on other sites

Hi

Reran a couple of times, the last after disbling the 512MB pagefile on the SSD & upping the HDD pagefile to 16000MB in case the tweak was tripping up somehow because of the small page file on the SSD. While Steam runs (once only) it hangs when I try to run A3. I've tried launching Steam as administrator (AFAIK it's set to that anyway) after right-clicking on the exec file, also tried the same with the arma3.exe. Just hangs. Bugger, it must be something specific to my system though I haven't a clue what it could be.

Thanks to you & TonyGrunt for pointing out my dumb errors with the load line. For more than 6 months RL stuff has kept me away from home much of the time, my Arma neurones must have gone comatose. Will try again later.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×