Re: memory allocation with malloc

2008-08-06 Thread Derek Ragona
At 01:16 AM 8/5/2008, Shyamal Shukla wrote: Hi All, I am trying to validate my understanding of how malloc works by means of the below C program which tries to corrupt essential information maintained by malloc for free() operation. The program allocates 4, 12 byte blocks (internally 16

memory allocation with malloc

2008-08-05 Thread Shyamal Shukla
Hi All, I am trying to validate my understanding of how malloc works by means of the below C program which tries to corrupt essential information maintained by malloc for free() operation. The program allocates 4, 12 byte blocks (internally 16 bytes are allocated for each 12 byte block).

Re: memory allocation with malloc

2008-08-05 Thread Giorgos Keramidas
On Tue, 5 Aug 2008 11:46:06 +0530, Shyamal Shukla [EMAIL PROTECTED] wrote: Hi All, I am trying to validate my understanding of how malloc works by means of the below C program which tries to corrupt essential information maintained by malloc for free() operation. The program allocates 4, 12

Re: memory allocation with malloc

2008-08-05 Thread Giorgos Keramidas
On Tue, 05 Aug 2008 09:58:40 +0300, Giorgos Keramidas [EMAIL PROTECTED] wrote: On Tue, 5 Aug 2008 11:46:06 +0530, Shyamal Shukla [EMAIL PROTECTED] wrote: However, this does not happen. Can someone please correct my understanding and provide me with a reference to the working of malloc() and

Re: memory allocation/deallocation (malloc experts needed)

2004-05-21 Thread Till Plewe
On Thu, May 20, 2004 at 05:36:31PM +0900, Charlie Root wrote: On Thu, May 20, 2004 at 01:42:00AM -0500, Dan Nelson wrote: In the last episode (May 20), Till Plewe said: My problem is essentially that freeing large numbers of small chunks of memory can be very slow. I have run into this

Re: memory allocation/deallocation (malloc experts needed)

2004-05-21 Thread Till Plewe
On Thu, May 20, 2004 at 09:28:12AM -0400, Chuck Swiger wrote: Till Plewe wrote: My problem is essentially that freeing large numbers of small chunks of memory can be very slow. I have run into this problem twice so far. [ ... ] One solution would be to divide the memory in larger regions and

Re: memory allocation/deallocation (malloc experts needed)

2004-05-20 Thread Dan Nelson
In the last episode (May 20), Till Plewe said: My problem is essentially that freeing large numbers of small chunks of memory can be very slow. I have run into this problem twice so far. Do you have a testcase? The attached program mallocs 1 million 128-byte blocks, then frees them. With

Re: memory allocation/deallocation (malloc experts needed)

2004-05-20 Thread Charlie Root
On Thu, May 20, 2004 at 01:42:00AM -0500, Dan Nelson wrote: In the last episode (May 20), Till Plewe said: My problem is essentially that freeing large numbers of small chunks of memory can be very slow. I have run into this problem twice so far. Do you have a testcase? The attached

Re: memory allocation/deallocation (malloc experts needed)

2004-05-20 Thread Chuck Swiger
Till Plewe wrote: My problem is essentially that freeing large numbers of small chunks of memory can be very slow. I have run into this problem twice so far. [ ... ] One solution would be to divide the memory in larger regions and to tell malloc which chunk to use for the next few calls,

memory allocation/deallocation (malloc experts needed)

2004-05-19 Thread Till Plewe
My problem is essentially that freeing large numbers of small chunks of memory can be very slow. I have run into this problem twice so far. 1) Shutting down python can take several minutes if I have used large dictionaries. The solution I use here is to exit python without freeing the allocated