Hi all !
I have a problem. I need to use two huge variables (square matrices), 500
MBytes each. My memory is 3GB RAM and 3GB swap. 300M of them occupied by
system.
Memory for the first one allocates well, without problems. But when program
tries to allocate memory for second matrix, "Out of memory" error occurs.
But there is a great amount of free memory !!!
Can you tell me, what is the reason and how I can fix it. Is there any
VisualC 7.0 tuning, connected with memory allocation ? It's acceptably to
storage variables in the swap. Is there any compiler directive, which
specify, that variable can be moved into the swap ?
I didn't find answers in the MSDN disk documentation. May be, someone know
the title of the Articles, connected with these questions.
Thank you, and sorry for my English :-) 4 1267
"Anatoly" <An*****@discussions.microsoft.com> skrev i meddelandet
news:FF**********************************@microsof t.com... Hi all !
I have a problem. I need to use two huge variables (square matrices), 500 MBytes each. My memory is 3GB RAM and 3GB swap. 300M of them occupied by system.
Memory for the first one allocates well, without problems. But when program tries to allocate memory for second matrix, "Out of memory" error occurs. But there is a great amount of free memory !!!
Can you tell me, what is the reason and how I can fix it. Is there any VisualC 7.0 tuning, connected with memory allocation ? It's acceptably to storage variables in the swap. Is there any compiler directive, which specify, that variable can be moved into the swap ?
I didn't find answers in the MSDN disk documentation. May be, someone know the title of the Articles, connected with these questions.
Thank you, and sorry for my English :-)
It's not a matter of how much memory space you have, but how
fragmented it is. Usually, the user address space is 2 GB (with the
other 2GBG reserved to the system). This doesn't mean that you can
allocate one 2 GB element, but that the sum of all your allocated
memory can approach 2 GB.
After you have allocated the first 500 MB element, there may very well
be enough space available to allocate 5 * 100 MB, but perhaps not a
single 500 MB element. When entering a parking lot, there might easily
be places for 5 cars, but perhaps not one single space for 5 cars.
Do you really (really!) need to have the elements allocated in such
big pieces, or can you possibly split them up in several smaller
parts?
Bo Persson
"Bo Persson" wrote: It's not a matter of how much memory space you have, but how fragmented it is. Usually, the user address space is 2 GB (with the other 2GBG reserved to the system). This doesn't mean that you can allocate one 2 GB element, but that the sum of all your allocated memory can approach 2 GB.
After you have allocated the first 500 MB element, there may very well be enough space available to allocate 5 * 100 MB, but perhaps not a single 500 MB element. When entering a parking lot, there might easily be places for 5 cars, but perhaps not one single space for 5 cars. Bo Persson
Thank you.
The problem in the time - in future the program will be optimized and
matrices will be much smaller, but now we need to solve some tasks quickly.
Do you know, how can I order the compiler to allocate memory as compactly,
as possible, witout "holes" ?
Anatoly,
You're best bet is to have your program allocate the two 500MB arrays on
the heap when it first starts. There is less likely to be any memory
fragmentation when you first start. You will, of course, have to pass
pointers to this allocated memory to the routines that need them, but that
is a small price to pay.
Bob Milton
"Anatoly" <An*****@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com... "Bo Persson" wrote:
It's not a matter of how much memory space you have, but how fragmented it is. Usually, the user address space is 2 GB (with the other 2GBG reserved to the system). This doesn't mean that you can allocate one 2 GB element, but that the sum of all your allocated memory can approach 2 GB.
After you have allocated the first 500 MB element, there may very well be enough space available to allocate 5 * 100 MB, but perhaps not a single 500 MB element. When entering a parking lot, there might easily be places for 5 cars, but perhaps not one single space for 5 cars. Bo Persson
Thank you. The problem in the time - in future the program will be optimized and matrices will be much smaller, but now we need to solve some tasks quickly.
Do you know, how can I order the compiler to allocate memory as compactly, as possible, witout "holes" ?
Hi,
Assuming that you really need a random access array so big, try to
get a Windows Server system that supports 3 GB for user mode (/3GB boot
switch)
or a system that supports PAE.
In the latter case you'll need to use special AWE API to allocate the memory
and manage the mapping window (it is not a true random access)
--PA
"Anatoly" wrote: "Bo Persson" wrote:
It's not a matter of how much memory space you have, but how fragmented it is. Usually, the user address space is 2 GB (with the other 2GBG reserved to the system). This doesn't mean that you can allocate one 2 GB element, but that the sum of all your allocated memory can approach 2 GB.
After you have allocated the first 500 MB element, there may very well be enough space available to allocate 5 * 100 MB, but perhaps not a single 500 MB element. When entering a parking lot, there might easily be places for 5 cars, but perhaps not one single space for 5 cars. Bo Persson
Thank you. The problem in the time - in future the program will be optimized and matrices will be much smaller, but now we need to solve some tasks quickly.
Do you know, how can I order the compiler to allocate memory as compactly, as possible, witout "holes" ? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Srijit Kumar Bhadra |
last post by:
Hello,
Here is some sample code with pywin32 build 203 and ctypes 0.9.6.
Best regards,
/Srijit
File: SharedMemCreate_Mutex_win32all.py
# This application should be used with...
|
by: Attila.Rajmund.Nohl |
last post by:
Hello!
I'm using KAI C++ Compiler (KCC) Version 4.0d on Sparc Solaris 8 with
Sun WorkShop 6 update 2 backend (KCC compiles C++ code to C than
uses the Sun compiler to produce machine...
|
by: Andrzej |
last post by:
Used to read newsgroup for answers, now have to ask for them as well.
I have an application (C#, .NET 1.1) that connects to local db on MSDE
2000 SP3a (using ADO from MDAC 2.71) on one side and...
|
by: Zeng |
last post by:
I finally narrowed down my code to this situation, quite a few (not all) of
my CMyClass objects got hold up after each run of this function via the
simple webpage that shows NumberEd editbox. My...
|
by: Sean Shanny |
last post by:
To all,
Running into an out of memory error on our data warehouse server. This
occurs only with our data from the 'September' section of a large fact
table. The exact same query running over...
|
by: saran |
last post by:
I am having a problem with MySQL consuming a lot of memory and
eventually throwing an Out of Memory error and restarting itself. The
symptoms are that swap usage continues to rise until some...
|
by: tgnelson85 |
last post by:
Hello, C question here (running on Linux, though there should be no platform specific code).
After reading through a few examples, and following one in a book, for linked lists i thought i would...
|
by: kumarmdb2 |
last post by:
Hi guys,
For last few days we are getting out of private memory error. We have a
development environment. We tried to figure out the problem but we
believe that it might be related to the OS...
|
by: George2 |
last post by:
Hello everyone,
Should I delete memory pointed by pointer a if there is bad_alloc when
allocating memory in memory pointed by pointer b? I am not sure
whether there will be memory leak if I do...
|
by: ravishi |
last post by:
Well, this is my first topic at this forum and I'm a newbie on C programming too.
I'm coding a little program and I've used some "dynamic arrays" on it. Compiling and running the program on Linux...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |