-
February 9th, 2014, 10:11 PM
#1
Store some variables in disk
Hi,
I am using Visual C++ to write an app. One problem is that the application will allocate a lot of object instances of a specific class CMyObject, maybe 400, 000. This will cause “Out of memory” error when total allocated CMyObject reaches 400,000.
To solve this problem, I just wonder when a new CMyObject instance is created, is it possible to specify so that the instance will allocate on a disk cache, or file mapping instead of the memory space?
Thanks
Alan
-
February 10th, 2014, 12:21 AM
#2
Re: Store some variables in disk
Most probably the need in allocating a half million objects indicates bad design issue.
Best regards,
Igor
-
February 10th, 2014, 08:34 AM
#3
Re: Store some variables in disk
What igor said.
Regardless of bad design issues
If you are exhausting the address space of your application (for a Win32 app this is 2Gb, possibly 3gb with a switch in the build settings and depending on which version of windows) then you will need to do any disk based management yourself.
Compiling as a Win64 app might work, though it's still probably bad design to have that many objects.
-
February 10th, 2014, 08:40 AM
#4
Re: Store some variables in disk
Hard to say without knowing what you're doing, but perhaps you need a database.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|