in reply to Abnormal memory in some modules
For Devel::Leak, when you call Devel::Lease::NoteSV it makes a table of all variables in use by Perl. Apparently when you call it again it doesn't get rid of the old table when it does so. You could report that as a bug. While a leak in Devel::Leak might be an amusing bug, it is hardly Perl's fault.
Other modules might do something like Memoize data from one call hoping to reuse it in the next. Even though memory usage goes up, that is not a bug. It is intentional behaviour. Sometimes it is inconvenient and becomes a problem - in which case complain to the author. Perl should not prematurely get rid of data that the programmer has told Perl to track.
In fact Perl has some intentional behaviour of this form. Lexical variables declared with my still tie up space after you return from a function even though that variable should never be accessed again. The point of this is to avoid having to take the performance hit of allocating space for the variable on your next pass - Perl just reuses the already allocated space.
There is known misbehaviour due to reference counting. But that is how Perl is documented to work, and it is the responsibility of people creating circular references to break them. Plus I don't often see people accidentally creating circular references.
The fact that you have not accidentally seen misbehaviour in your own modules is an indication that Perl is pretty good about not leaking memory. If you do find a memory leak and can identify what causes it to leak memory, and it is something that shouldn't, then that is a bug. But unless you have something specific, the report is not very useful for making Perl better, and likely isn't a problem with Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Abnormal memory in some modules
by piotr (Initiate) on Aug 17, 2004 at 13:59 UTC | |
by tilly (Archbishop) on Aug 17, 2004 at 15:46 UTC |