Sign in to follow this  
TomMettam

Memory usage rockets when screen locked

Recommended Posts

TomMettam    125

Hi all

 

I'm building an engine, and in this case it's built for Windows / DirectX 11 via Visual Studio 2013. I'm trying to diagnose a really awkward problem.  When I build for release configuration only, the memory usage of my application doubles when the screen is locked. (I'm running Windows 8.1 if it makes a difference).

 

It doesn't happen when built for debug, and while the memory profiler shows the huge memory leap, it doesn't show any sign of it in the heap:

 

profiler.jpg

I'm not really sure how to go about diagnosing this issue. If I take a look at one of these snapshots, it shows the heap at approximately 32mb, and nothing else.

 

Does anyone have any idea what the culprit might be?

Edited by TomMettam

Share this post


Link to post
Share on other sites
TomMettam    125

If I were to make a guess, I would say that DXGI is paging all of your memory off the GPU and into system memory.

 

Interesting. If true, is there anything I can do to prevent this?

Share this post


Link to post
Share on other sites
Aardvajk    13207

If I were to make a guess, I would say that DXGI is paging all of your memory off the GPU and into system memory.

 
Interesting. If true, is there anything I can do to prevent this?


"Locking" the memory means making it accessible to the CPU, so not really, no. Why do you need to lock it? Maybe you can push whatever operations you are doing on the locked buffer onto the GPU somehow.

Share this post


Link to post
Share on other sites
TomMettam    125

 

"Locking" the memory means making it accessible to the CPU

 

 

To be clear, I'm not talking about locking buffers - I mean physically locking the workstation (Ctrl - Alt - Delete  -> Lock) - for some reason this causes the effect mentioned.

Share this post


Link to post
Share on other sites
Aardvajk    13207

"Locking" the memory means making it accessible to the CPU

 
To be clear, I'm not talking about locking buffers - I mean physically locking the workstation (Ctrl - Alt - Delete  -> Lock) - for some reason this causes the effect mentioned.

Heh, okay, sorry :)

It's likely that causes a device lost. If you have managed resources on the GPU they will be paged into system memory so they can be restored later.

The only way to avoid this would be to abandon resources on device lost instead but I'm not even sure that is possible post D3D9.

Share this post


Link to post
Share on other sites
TomMettam    125

 

It's likely that causes a device lost. If you have managed resources on the GPU they will be paged into system memory so they can be restored later.

The only way to avoid this would be to abandon resources on device lost instead but I'm not even sure that is possible post D3D9.

 

 

That's the conclusion I came to, also.  However, as you mention, we don't get any "device lost" signalled when this happens (with DX11, "device lost" only occurs on major events  such as a driver upgrade).

 

I guess I will have to just ignore this and let DX do its thing internally.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this