This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: improving malloc

On Sat, Jan 05, 2013 at 10:02:42AM +0100, OndÅej BÃlka wrote:
> As malloc is concerned I have several ideas how to improve it.

I also want to comment other suggestions from wiki. Here is first

Chris Metcalf: 
* Hooks to allow arenas to be created using huge pages (either default
size or particular sizes)  

This has problem that huge pages increase memory usage. When application
overcommit memory then small pages are advantage. 

Second problem is fork. It is wasteful to copy huge page when only small 
part changes.

My ideas how to address this is either:

1) Use new function(say huge_malloc) so programmer is aware of these

2) Profiling. One could track how many pages allocations used/ if fork
happened and then decide if huge pages are profitable. 

It has drawback that programmer must do profiling. When programmer
does this he can add suitable mallopt. 

Huge pages are much better with garbage collection runtimes as heap
compactification reduces first problem.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]