[OT] finding memory hungry bits of my code

Edmund von der Burg evdb at ecclestoad.co.uk
Thu Apr 9 14:08:26 BST 2009


2009/4/9 Andy Armstrong <andy at hexten.net>:
> That sounds as if it could just be Perl getting up to cruising (memory)
> altitude. Perl isn't especially keen on giving memory back to the OS once
> it's used it; instead it keeps it hanging around and uses it to satisfy
> future allocations.

Perhaps you're right - but our cruising altitude would seem to be very
high: our biggest processes according to top:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 2050 web       15   0  126m 112m 5624 S    0  1.4   0:21.66
/usr/sbin/apache-perl
 1702 web       15   0  126m 112m 5420 R    6  1.4   0:22.88
/usr/sbin/apache-perl
 3511 web       20   0  124m 110m 5544 S    0  1.4   0:13.07
/usr/sbin/apache-perl
 4198 web       15   0  124m 110m 5560 S    9  1.4   0:08.84
/usr/sbin/apache-perl
 2037 web       15   0  124m 110m 5588 S    0  1.4   0:17.96
/usr/sbin/apache-perl
 3143 web       25   0  122m 108m 6116 S    0  1.3   0:15.10
/usr/sbin/apache-perl
 1321 web       17   0  121m 108m 6356 S    0  1.3   0:22.96
/usr/sbin/apache-perl
 1329 web       15   0  121m 108m 6348 S    0  1.3   0:18.82
/usr/sbin/apache-perl
 3160 web       16   0  119m 105m 5572 S    3  1.3   0:13.70
/usr/sbin/apache-perl
 3512 web       16   0  117m 104m 6292 S    2  1.3   0:10.58
/usr/sbin/apache-perl
 3155 web       15   0  118m 104m 5588 S    0  1.3   0:14.26
/usr/sbin/apache-perl
 3492 web       15   0  117m 104m 5572 S    4  1.3   0:12.85
/usr/sbin/apache-perl
 3151 web       18   0  117m 103m 4504 S    4  1.3   0:15.30
/usr/sbin/apache-perl

I'll be honest and say that the different types of memory has always
confused me - reading up on  wikipedia made it worse :)

The times for these processes is low on account of them getting reaped
at a certain size.

Do these numbers look reasonable to others? The SHR value seems crazy
low, but that might be me reading it all wrong.

Almost everything gets preloaded in our startup.pl script so it should
get shared.

Thanks for your help on this.

Cheers,
  Edmund.


More information about the london.pm mailing list