I am working on a Direct3D rendering application that uses a lot of texture RAM. I notice that if I allocate a Pool.Default volume texture:

   _texture = new VolumeTexture(device, size.Width, size.Height, size.Depth, 1, Usage.None, Format.L16, Pool.Default);

my process's system memory decreases by the same amount I allocate on the video card. I think this is unexpected. This texture is supposed to be video-memory only.

Effectively this means I can not use all texture RAM on high end video cards, I can not afford to lose a whole gigabyte of system RAM. We're short on adress space as it is....

Is there anybody who knows what's happening here? Are there ways to prevent this from happening?

This was seen on Windows 7 64 bit from a 32 bit process, using Directx 9c, with several different nVidia cards. The process is marked as /LARGEADRESSAWARE to make sure we get as much as adress space as possible.

You may have guessed by now that I am not writing a game.... but I assume the Direct3D experts are here to be found.... And I can imagine this issue affects games as much as it affects us...


This appears to happen only with Volume Textures. If I allocate 2D textures of the same size it does not happen. By default my volume textures were 32megabytes each. If I make them smaller (I tried down to 2megabytes each), There are still blocks being allocated. According to VMMap, each texture gets a 32 meg block in my process, flagged as "Read/Write/WriteCombine".

The fact that they are labeled as "WriteCombine" makes me really curious, no other block of memory is labeled like that.

  • \$\begingroup\$ This is indeed unexpected. I'm curious, are you preloading the texture at a later stage? Or simply using it completely empty? \$\endgroup\$ – Michael Kissner Sep 17 '11 at 22:08
  • \$\begingroup\$ That code appears to be C#; are you using Managed DirectX or SlimDX (and if the former, are you aware that the API is deprecated)? \$\endgroup\$ – user1430 Sep 17 '11 at 23:34
  • \$\begingroup\$ Does this only happen with volume textures? \$\endgroup\$ – Adam Sep 18 '11 at 0:31
  • \$\begingroup\$ @josh: oh yeah, i am using slimdx. Should have included that. \$\endgroup\$ – jdv-Jan de Vaan Sep 18 '11 at 9:20
  • \$\begingroup\$ @MichaelKissner: We are allocating blocks in advance in a standard format, and recycle them for different data. The memory pressure increases when I allocate it, and it never goes away. \$\endgroup\$ – jdv-Jan de Vaan Sep 18 '11 at 10:14

Specifying the default pool does not instruct Direct3D to put the resource on the GPU. It instructs Direct3D to put the resource in the best pool for the usage you specified for the resource.

The task manager is a very poor way of measuring performance, in general. It's possible the allocation is transient and done by the D3D API in order to transfer some data to or from the card (as allocation of default pool resources can evict managed pool resources as needed to satisfy the request).

Also note that on Windows 7, you'll be using the WDDM which can virtualize GPU memory (although generally I think you shouldn't see issues with this unless you are using the *Ex variant of the device, which I don't believe Managed DirectX can create).

| improve this answer | |
  • \$\begingroup\$ Thanks for the info. I am not relying solely on the task manager, i can see the allocated blocks also in vmmap (a sysinternals tool). \$\endgroup\$ – jdv-Jan de Vaan Sep 18 '11 at 9:26
  • \$\begingroup\$ Okay good. SlimDX doesn't do any allocations (of note) in the VolumeTexture ctors either, so this must be something the native API is doing. I'm not sure why though. Have you considered asked on the DirectXDev mailing list? discussms.hosting.lsoft.com/SCRIPTS/WA-MSD.EXE?A0=DIRECTXDEV \$\endgroup\$ – user1430 Sep 18 '11 at 16:48
  • \$\begingroup\$ Thanks for the mailing list pointer. I will try that if I don't get any more answers here. This is the first forum where I took this issue so far. And thanks for SlimDX, by the way. \$\endgroup\$ – jdv-Jan de Vaan Sep 18 '11 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.