Forum Discussion

Anonymous's avatar
Anonymous
12 years ago
Solved

[WORKAROUND] NP Pool Memoryleak

Hey you memoryleak-tortured players out there!

I've created a little application as a workaround for the annoying NP-MemoryLeak in BF4.

Initially I just did that for myself but as there are many other unfortunate memoryleak-victims out there I've decided to share this little application with you.

So what is this application and what does it do?

It's a Powershell-Script (Powershell is the successor of the classic Windows-Commandline and is delivered with Windows since Vista) which basically monitors the NonPagedPool-Area of your memory and kills the BF4-process when a memory-leak is detected.

This scripts is just an assistance for early memory-leak-detection and prevents your memory from total overflow. Thus you don't have to restart
your PC with every memory-leak. You only have to restart the game. Since the memory-leak always occurs on mapchange (not midgame) this is a small price for not having to restart your PC.

How to run this application?

First you need to set the Execution-Policy of Powershell. You do this by opening powershell with admin-privilegs and typing in the following command:

Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted

This will allow powershell to run scripts without any confirmation! (You will have to do this step only once)

Then you just have to double-click the script everytime you want to play bf4 and close it when you are done playing. 

The script is also configurable through various parameters. For details please take a look at the help-topic via the command

help [Path to Script] -full

Where to download?

[Removed - Admin.]

Problems / Suggestions?

If you're experiencing any errors while executing the script, please post them together with your system-specs and I will look into it!

Also feel free to leave suggestions if you are missing something.

  • Anonymous's avatar
    Anonymous
    12 years ago

    ok, then I am done here. Bye.

10 Replies

  • Seems interesting. Since the memory is never released but the leaking process is "just" closed down I presume that eventually the memory will still get full if you play enough? I guess that depends on how you detect the memory leak.

  • Anonymous's avatar
    Anonymous
    12 years ago

    The script requests the size of the nonPagedPool every second (by default) from the system.

    It then calculates the difference between the current and previous messurement (delta-value). If this delta gets up to 10MByte or more (by default) the programm "assumes" that there is a memory-leak and kills the bf4-process.

    I've tested alot with the size of this delta-limit and my system was always leaking memory when the 10 MByte-Cap was reached. So this assumption might not be 100% accurate - but nearly 😉

    As a "fallback" there is second limit: When the general size of the NP-Pool reaches 500MByte (by default) then the program also assumes that there must be a memoryleak and kills the BF4-Process.

    This fallback prevents the system from out-of-memory, when the delta-limit is set too high.

    To your question: Yes, the NP-Pool will still raise with this workaround activated - but much less than without it 😉

    As an example: Normally when I experienced a memory-leak on my pc while playing bf4, the NP-Pool raised up to 6 GByte (75% of my total memory) until I realized it. 

    No with the script running in the background, I experienced 3 memory-leaks, but my NP-Pool only raised to 270MB without restarting my pc!

    But to make this clear: This is not meant to be a total solution for this issue - it's more like a firefighter (just "extinguishing the fire") 😉

  • EA_Barry's avatar
    EA_Barry
    Icon for Community Manager rankCommunity Manager
    12 years ago

    While this script is probably well intentioned, I have removed the link to it.

    We cannot allow links to scripts, especially if it involves the user modifying the execution policy of Powershell and the like.

  • Anonymous's avatar
    Anonymous
    12 years ago

    😕mileyfrustrated:

    So it won't change your mind, if I find an alternate solution for the "Execution Policy"-Part?

  • Anonymous's avatar
    Anonymous
    12 years ago

    Then please provide the community with something that will help them with the issues they are experiencing.  Sigh.

  • EA_Barry's avatar
    EA_Barry
    Icon for Community Manager rankCommunity Manager
    12 years ago

    chrisdturk,

    It is not just the execution policy part, rather having a link to a script which modifies how someones' computer functions. You can of course post a link to that file elsewhere. We cannot allow it to be linked to from AHQ though.

  • Anonymous's avatar
    Anonymous
    12 years ago

    ok, then I am done here. Bye.

About Battlefield Franchise Discussion

Discuss the Battlefield games in this community forum.132,986 PostsLatest Activity: 3 days ago