in reply to General memory management for embedded/extended perl with C threads

You may already know this but there is discussion of memory allocation in perldoc perlguts.

It is suggested that you enable the version of malloc that is dis- tributed with Perl. It keeps pools of various sizes of unallocated memory in order to satisfy allocation requests more quickly. However, on some platforms, it may cause spurious malloc or free errors.
I have found cases where perl's alloc doesn't play well in a threaded application. We had to revert to the OS alloc functions. Unfortunately if you use the OS alloc function, you will loose some very valuable debugging features. perldoc Devel::Peek.

Mr. Rock, please meet Mr. Hard Spot.


"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


OSUnderdog
  • Comment on Re: General memory management for embedded/extended perl with C threads

Replies are listed 'Best First'.
Re^2: General memory management for embedded/extended perl with C threads
by Anonymous Monk on Nov 15, 2004 at 12:53 UTC
    Thanks for the reply osunderdog.

    How did you revert to using the OS's alloc functions?

      To see what you're using now:
      use Config qw|config_vars|; print "Using Perl Malloc? "; config_vars('usemymalloc'); print "\n";
      I just ran through the perl configure and here is the salient question:
      Do you wish to attempt to use the malloc that comes with perl5? [n]

      "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


      OSUnderdog