top 8 entry from grpof of my app :-(

janderson askme at me.com
Sat Jan 13 15:27:34 PST 2007


%u wrote:
> Thanks for the info.
> 
> Sorry, I should mention the program do some game tree searching.  It need to
> allocate some memory for each new node, and then do some calculation. In that
> test, the total memory allocated is about 500M, and  take about 10 min.  I should
> also mention most part of the run it only allocates memory, but doesn't release
> much until the end when the program exits.
> 
> 

You should try pre-allocate a pool of memory for the nodes (a big 
array).  That's standard practice with trees.  Probably don't even need 
to disable the GC then.

Also if its for a game, you should avoid or remove all allocation during 
the real-time part of the game (most high performance games (in any 
language) work this way).  Allocation should mostly occur during load 
times and between levels.

You might also try nedmalloc.

Good luck,
-Joel


More information about the D.gnu mailing list