Re: Improving the memory allocator - Mailing list pgsql-hackers

From Radosław Smogura
Subject Re: Improving the memory allocator
Date
Msg-id 60216d868e5dc633d04f47203da50253@mail.softperience.eu
Whole thread Raw
In response to Improving the memory allocator  (Andres Freund <andres@anarazel.de>)
Responses Re: Improving the memory allocator  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
I didn't followed this topic carefully, so sorry If I wrote something that was written, but I thought about following
approachat least for message sending, etc.:
 
1. When initializing MemoryContext (pool) give one parameter that will be stack size. Stack is addition to normal
operations.2.Operations on stack are only allocations, so alloc will be just pointer bump.3. When allocating memory for
messages,internally set size to be 1/3 greater (or 2/3 I don't remember well) for realloc, may help when encoding
changeoccurs.3. free is no op (as it was pointed), stack will be released or pointer resetted, when context is
released
From one point of view this may waste some memory (no free), but for messages should not happen, and even giving 100kb
ofmemory for stack may be quite enough, depending ofcourse how many data you send.
 
Regards,Radek


pgsql-hackers by date:

Previous
From: Yves Weißig
Date:
Subject: Re: operator classes for index?
Next
From: Merlin Moncure
Date:
Subject: Re: Proposal - asynchronous functions