- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In my project I need a 3D-array with require a large amount of memory.
Sometimes memory allocation fails, even if there should be enough memory available.
So I did a memory test.
I tested the maximum allocatable size for a single array (with the command ALLOCATE), and the size of many smaller allocatable arrays. So the maximum allocatable single array was only 700 MB, where the total size using multiple arrays was 2000 MB's.
So my question is, is there any possibility to tell the system to de-fragment system memory in order to make a larger memory-block accessible, instead of many small memory fragments ?
Sometimes memory allocation fails, even if there should be enough memory available.
So I did a memory test.
I tested the maximum allocatable size for a single array (with the command ALLOCATE), and the size of many smaller allocatable arrays. So the maximum allocatable single array was only 700 MB, where the total size using multiple arrays was 2000 MB's.
So my question is, is there any possibility to tell the system to de-fragment system memory in order to make a larger memory-block accessible, instead of many small memory fragments ?
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This would be highly dependent on which OS you use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use Windows XP/windows 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think it is not possible (other programs can fragment memory and there is no way to force them to change used memory position (i.e. address of its variables)).
Use smaller arrays and pointers to work with them.
Jakub
Use smaller arrays and pointers to work with them.
Jakub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you allocate many arrays yourself then if possible you should allocate the largest arrays first. But if you do many allocate/deallocate calls then memory is bound to get fragmented and the memory manager (garbage collector) may not be quite up-to-date with your process (so I have been told)
What is your definition of "large amount of memory" ? How big are your arrays ?
Les
What is your definition of "large amount of memory" ? How big are your arrays ?
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jaeger0,
Can you upgrade your system to a 64-bit operating system?
If you are unable to do this then consider writing a 2D array of 1D arrays
Jim
Can you upgrade your system to a 64-bit operating system?
If you are unable to do this then consider writing a 2D array of 1D arrays
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By the way, yourWindows 7 serial number should be good for both x32 and x64 versions of Windosw 7.
Jim
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a 64bit version, but my programm is compiled as a 32 bit version, since one library I use is still in 32 bit, so I guess I have no other option to split up my array.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What portion of your code uses the 32-bit library?
If this 32-bit library does not use the large 3D array, or can be written to use smaller pieces of the 3D array, then consider writing your application in two pieces. Or properly phrased as in two processes. One process can be in 64-bit, the other in 32 bit. The two processes can share data using a memory mapped file(s) for data sharing. And there are various inter-process communication methods (Events etc...).
Jim Dempsey
If this 32-bit library does not use the large 3D array, or can be written to use smaller pieces of the 3D array, then consider writing your application in two pieces. Or properly phrased as in two processes. One process can be in 64-bit, the other in 32 bit. The two processes can share data using a memory mapped file(s) for data sharing. And there are various inter-process communication methods (Events etc...).
Jim Dempsey
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page