Think of process heap memory as a chessboard - one area made up of 64 small blocks.
suppose each one of those is 1 MB.
You make 64 calls to calloc, get 64 pointers to 1MB each. Next you free 10 of them at random.
How many will contiguous? Probably none. Will you have four adjacent squares. Very probably: No.
Now what happens when you want to calloc 4MB? You have 10MB free but it is not contiguous. Some versions of malloc will barf on this, some will call brk() to get an additional n MB from the OS. This is heap fragmentation. You now know that there are several different versions of malloc code. When you have malloc problems like you are having:
1. Try a malloc debugger
2. See what malloc you are using, change it if need be.
sysadmins can control during system installation and later system setup which version(s) of malloc are on a system, and which version of malloc is used by default during linking. So can other programmers.
Different versions of gcc also have different malloc implementations.
This is hypothesis you get to test with dmalloc. And other tools.
Each of these results suggests a different workaround.
Your problem box may show something different than what you see elsewhere.
Did you compile locally or port the executable directly?
Last edited by jim mcnamara; 02-23-2012 at 08:36 AM..
This User Gave Thanks to jim mcnamara For This Post:
On SunOS 5.8 I get an error when starting a large Java process with over 2Gb memory.
Error occurred during initialization of VM
Could not reserve enough space for object heap
When stopping several other Java processes we can start this process. This seems to indicate that we don't have... (11 Replies)
Hi,
I have 2 systems with same hardware and software. One system is giving me error "Error occurred during initialization of VM Could not reserve enough space for object " when I tried to increase JBoss App's heap size to 2GB while the other system is running fine without any issue. Is there... (5 Replies)
hi... i want to find oracle allocate how many memory really..
i execute this code to list memory on unix system : ps -eo pmem,args | sort -k 1 -r -n
outputs ;
%mem command
12.9|ora_smon_RTX
12.9|ora_s000_RTX
12.9|ora_reco_RTX
12.9|ora_qmnc_RTX... (2 Replies)
Hi,
In my proj, one process was running for 2 days. after 2 days its throwing an error message "shmget failed cannot allocate memory". the same problem happened every time.i.e. i can reproduce the same issue if my process is running for every 2 days for a same operation.Within this 2 days there... (1 Reply)
Hi,
In my proj, one process was running for 2 days. after 2 days its throwing an error message "shmget failed cannot allocate memory". the same problem happened every time.i.e. i can reproduce the same issue if my process is running for every 2 days for a same operation.Within this 2 days there... (1 Reply)
Hi,
In my proj, one process was running for 2 days. after 2 days its throwing an error message "shmget failed cannot allocate memory". the same problem happened every time.i.e. i can reproduce the same issue if my process is running for every 2 days for a same operation.Within this 2 days there... (1 Reply)
hi
I want to take string as a input from user and the string is very very length. From the lengthy string i have to substring take first 16 letters, then next 8 letters,................... Please guide me how to write program to take lengthy string from user and sub string it.
Thanks (4 Replies)
On SunOS 10 get an error when starting a large Java process with over 2Gb memory.
Error occurred during initialization of VM
Could not reserve enough space for object heap
i have 32G memory !! , swap = 31G
Please any advice !!! (3 Replies)