09-04-2014
Quote:
Originally Posted by
imagtek
It appears that after I free() a block of memory that I am using the system, for unknown reasons, does not make this resource immediately available again for an indeterminate period. I free the memory, but the system performs as if the memory is still in use. There is no logic issue of the memory being freed; the only path to a return is through the free() statement.
Perhaps I misunderstood you before. So the problem isn't the speed of the free(), but the memory use?
It's like achenle says, it
is in use. malloc() assumes if you've allocated it before, you're going to allocate it again, and keeps it in the pool for later. If you want control over when exactly it's released to the OS, you need mmap.
10 More Discussions You Might Find Interesting
1. Windows & DOS: Issues & Discussions
Hi There,
I have upgraded the DELL poweredge 2600 server memory from 2GB to 4GB. However, the memory only showed at 2GB of utilization. How to make sure that the server is full utilize of 4GB of memory. Is there the Virtual memory need to be reconfigure as this server is run on windows 2000 and... (2 Replies)
Discussion started by: vestro
2 Replies
2. Linux
Hi All
Any idea? why am I having this memory issue?
perforce@ixca-pforce-bak:/home/p4-demo-root$ diff checkpoint_offline ../p4-demo-root2/checkpoint.1150
diff: memory exhausted
Thanks a lot
C Saha (0 Replies)
Discussion started by: csaha
0 Replies
3. AIX
Hi friends..
Help to solve this issue...
Is there any parameter setting to control or limit the size of the shared memory a process can attach for the below specified environment?
The man pages says it can attach upto segments of size 2GB. But when our process (which also connects to... (0 Replies)
Discussion started by: sdspawankumar
0 Replies
4. Linux
Hi all,
I was compiling my glibc 2.6.1 source files on a new kernel 2.66.22.6 and it seems that i am running into issues with the Virtual Memory. It displays the error message:
virtual memory exhausted: Cannot allocate memory
I saw an article on how to adjust the parameters but i can't... (5 Replies)
Discussion started by: scriptingmani
5 Replies
5. Solaris
One of our project has exceeded its assigned max-memory-locked by 3 times .. The said project is using around 9 gigs as described by rss parameter in prstat -J .. and the max-project-memory parameter has been defined as 3gigs .. is it normal or we are monitoring the project memory usage in wrong... (2 Replies)
Discussion started by: fugitive
2 Replies
6. AIX
Currently server have load while there is no heavy things running, just oracle database/ application server oracle. I don't understand why server have heavy load, 22GB is under buffer, how to clean buffer/memory in AIX
load averages: 9.42, 9.43, 9.68; 05:25:08
141 processes: 125 idle, 16... (12 Replies)
Discussion started by: learnbash
12 Replies
7. Solaris
We have a zone configured in our X4600 machine with memory capped to 16GB. Most of the time zone is running with high physical memory utilization. It seems from "top" command shows that the command "kernel" is locks 15GB phy. memory and not using swap memory. Whenever we restart the application... (2 Replies)
Discussion started by: rock123
2 Replies
8. AIX
I have a server with 300Gb allocated to it. Some times I observed in topas
Comp% 73 and Non comp 35% and client is also 35% and my paging is showing 92%. If my physical memory utilized only 70% then why paging is so high.
And what is relation between Comp, noncomp and client? If the memory... (1 Reply)
Discussion started by: powerAIX
1 Replies
9. Red Hat
I could not find what is consuming the memory, generated DSET reports and NO hardware wise memory issue. 64 GB RAM on a server yet all I could see is a very limited memory available. I am not sure if I am reading this correct or not. I have used free -t -m and cat /proc/meminfo (results below)... (3 Replies)
Discussion started by: rsheikh01
3 Replies
10. Linux
Hi,
In our production box i can see the Swap space using the below command
free
total used free shared buffers cached
Mem: 65963232 41041084 24922148 0 877160 35936292
-/+ buffers/cache: 4227632 61735600
Swap: 4192880 ... (6 Replies)
Discussion started by: ratheeshjulk
6 Replies
LEARN ABOUT MOJAVE
bsdmalloc
bsdmalloc(3MALLOC) bsdmalloc(3MALLOC)
NAME
bsdmalloc - memory allocator
SYNOPSIS
cc [ flag ... ] file ... -lbsdmalloc [ library ... ]
char *malloc(size);
unsigned size;
int free( ptr);
char *ptr;
char *realloc( ptr, size);
char *ptr;
unsigned size;
These routines provide a general-purpose memory allocation package. They maintain a table of free blocks for efficient allocation and coa-
lescing of free storage. When there is no suitable space already free, the allocation routines call sbrk(2) to get more memory from the
system. Each of the allocation routines returns a pointer to space suitably aligned for storage of any type of object. Each returns a
null pointer if the request cannot be completed.
The malloc() function returns a pointer to a block of at least size bytes, which is appropriately aligned.
The free() function releases a previously allocated block. Its argument is a pointer to a block previously allocated by malloc() or real-
loc(). The free() function does not set errno.
The realloc() function changes the size of the block pointed to by ptr to size bytes and returns a pointer to the (possibly moved) block.
The contents will be unchanged up to the lesser of the new and old sizes. If the new size of the block requires movement of the block, the
space for the previous instantiation of the block is freed. If the new size is larger, the contents of the newly allocated portion of the
block are unspecified. If ptr is NULL, realloc() behaves like malloc() for the specified size. If size is 0 and ptr is not a null pointer,
the space pointed to is freed.
The malloc() and realloc() functions return a null pointer if there is not enough available memory. They return a non-null pointer if size
is 0. These pointers should not be dereferenced. When realloc() returns NULL, the block pointed to by ptr is left intact. Always cast the
value returned by malloc() and realloc().
If malloc() or realloc() returns unsuccessfully, errno will be set to indicate the following:
ENOMEM size bytes of memory cannot be allocated because it exceeds the physical limits of the system.
EAGAIN There is not enough memory available at this point in time to allocate size bytes of memory; but the application could try
again later.
Using realloc() with a block freed before the most recent call to malloc() or realloc() results in an error.
Comparative features of the various allocation libraries can be found in the umem_alloc(3MALLOC) manual page.
brk(2), malloc(3C), malloc(3MALLOC), mapmalloc(3MALLOC), umem_alloc(3MALLOC)
WARNINGS
Use of libbsdmalloc renders an application non-SCD compliant.
The libbsdmalloc routines are incompatible with the memory allocation routines in the standard C-library (libc): malloc(3C), alloca(3C),
calloc(3C), free(3C), memalign(3C), realloc(3C), and valloc(3C).
21 Mar 2005 bsdmalloc(3MALLOC)