Gradual increase in memory usage

Alan DeKok aland at deployingradius.com
Wed Jan 15 15:25:30 CET 2014


Бен Томпсон wrote:
> I have an instance of FreeRADIUS which is gradually consuming memory.

  You have a version of Perl which is gradually consuming memory. :(
...
> ==00:00:00:55.542 15239== 131,904 bytes in 180 blocks are definitely
> lost in loss record 545 of 547
> ==00:00:00:55.542 15239==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
> ==00:00:00:55.542 15239==    by 0x76F6C45: Perl_safesysmalloc (in
...
> ==00:00:00:55.542 15239== 146,544 bytes in 2,246 blocks are definitely
> lost in loss record 546 of 547
> ==00:00:00:55.542 15239==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
> ==00:00:00:55.542 15239==    by 0x76F6C45: Perl_safesysmalloc (in
...
> ==00:00:00:55.542 15239== 277,664 bytes in 3,218 blocks are definitely
> lost in loss record 547 of 547
> ==00:00:00:55.542 15239==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
> ==00:00:00:55.542 15239==    by 0x76F6C45: Perl_safesysmalloc (in
...

> I would be grateful if anyone could take a quick glance at this output
> and let me know if it shows anything untoward.

  Perl has a garbage collector, but it is notoriously bad.  Your Perl
script is using lots of memory, and leaking.  Since the Perl interpretor
is running inside of FreeRADIUS, it looks like FreeRADIUS may be
leaking.  It's not.

  Fix the Perl script so that it doesn't leak memory.  Use fewer
variables, don't automatically create new variables, ensure that you
delete every "complex" object you can.

  I haven't done Perl in a while, so that's about all the advice I can
offer.

  Alan DeKok.


More information about the Freeradius-Users mailing list