Out Of Memory Error Allocating large chunks (> 1GB) of pinned-memory fails

(Sorry if this has already been resolved, I couldn’t find anything when searching the forums).


Windows 7 64-bit


When trying to allocate a large chunk (> 1GB) of host, page-locked (pinned) memory I get the following error:
Out of Memory

This occurs for any type of cuda page-locking API calls (CudaHostAlloc, Mallochost, calling VirtualAlloc then cudaHostRegister).

What CUDA and/or Windows settings do I need to change to be able to allocate large chunks of pinned host memory?

Reading the release notes, I found:

o The maximum size of a single allocation created by cudaMalloc
or cuMemAlloc is limited to:
MIN ( ( System Memory Size in MB - 512 MB ) / 2, PAGING_BUFFER_SEGMENT_SIZE )
For Vista, PAGING_BUFFER_SEGMENT_SIZE is approximately 2GB.

I’ve tried manually setting Paging File Size to 8 - 16GB. Looking at the task manager says I have at least 3GB of free memory.

Has anyone had this problem? Or can someone point me in the right direction to resolve this problem?

Any help would be appreciated.


I believe that pinned memory must be physically contiguous. I am unfamiliar with Window’s virtual memory system and particularly don’t know what effort Windows makes to obtain contiguous pages. It might be that they are just not available.

You best chance to find a large contiguous range of memory pages probably is directly after a cold boot.

Thank you for your reply.

I’ve checked into that aspect and have validated that cudaHostAlloc allocates scattered 4kB pages.

Also, the same error occurs on cold start ups.

Is this more likely to be a Windows problem than a setting in Cuda?


I have kind of the same problem here…

My setup is:
CUDA 4.0 (the last version).
Windows 7 64-bit (with driver version 275.33)

And I am basically trying to do this:

void* buffer;
size_t size = 1358954496; //(~1296MB)
cudaHostAlloc( &buffer, size, cudaHostAllocDefault);

And all I get is … out of memory.

Is anyone else still having this problem? Any advice about how to get around this problem? Why am I not allowed to allocate ~1GB of memory on a system with… 18? With malloc is no a problem to allocate this amount of memory. Yes, I know the difference between page-locked and paged memory, but it is “odd” to me to see that on a machine with at least 16GB free memory I can’t get 1-2 GB of page-locked memory.

I have tried also with Yes(/LARGEADDRESSAWARE) for VC2010 on Win7 and the same… out of memory result.
With Ubuntu 11.04 on the same machine is working just fine… I have allocated few “smaller” blocks of 1296MB or one big block of around 6GB.