0

I've got a program in xna and I'm loading up 2gb+ of data (not a problem, it's meant to). It works fine at anything below 1.7gb but as soon as it goes over that it'll throw this.

"Insufficient memory to continue the execution of the program."

Or another time I had

"Insufficient memory to continue the execution of the program."

I've got 8gb of ram and my GPU has 2gb. My system definitely isn't running out of memory as I can load up other programs with very high memory usage and it'll still end at 1.7gb. Is there a fix to this?

Levi H
  • 3,426
  • 7
  • 30
  • 43
  • 2
    Here is an explanation http://stackoverflow.com/questions/1087982/single-objects-still-limited-to-2-gb-in-size-in-clr-4-0 – Lukasz Madon May 06 '12 at 01:27

3 Answers3

2

Are you storing all that data in one object? You might be running into a CLR limitation.

Check out this post: CLR object size limitations

Community
  • 1
  • 1
itsme86
  • 19,266
  • 4
  • 41
  • 57
2

1) it's most likely running 32-bit (you can run taskmgr and be able to tell)

2) even if there's enough free memory to satisfy a request, there may not be enough contiguous free memory. memory fragmentation becomes an issue as you start running out of the virtual memory space for a process.

There's a good article that includes these (and other) issues:

Investigating Memory Issues

James Manning
  • 13,429
  • 2
  • 40
  • 64
2

See Tim's comment on this answer. I have observed the same limitations. As XNA on windows is limited to 32-bit processes, loading that much data (2gb) is pretty much impossible.

Community
  • 1
  • 1
Joh
  • 2,380
  • 20
  • 31
  • 3
    most likely more trouble than it's worth, but just in case, there's always changing the virtual memory split from 2/2 to 3/1 with the /3GB boot option :) With recent Windows, it's bcdedit /set increaseuserva - see http://msdn.microsoft.com/en-us/library/windows/hardware/ff542202.aspx – James Manning May 08 '12 at 18:25