Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    39

    Default Memory Leak - How do you diagnose one?

    I have a memory leak and am having no luck at finding it.

    Let me first tell you a sordid little story that will set this up.

    I am running a Virtuosso VE with whm / cpanel provided by a vendor in his operating center.

    I was on a VE where everything was running just fine.

    My vendor migrated me to a new box with the latest and greatest version of Virtuosso (I didn't ask for the migration, but that is a different story.)

    As far as I know, everything was fine at that point (although, it is possible that I didn't notice the problem at that point)

    I went into root whm and there was an Apache Security notice. So, I recompiled to fix the security leak. The recompile did not work correctly and my vendor had to fix it.

    Since then, I now have a memory leak that runs out the private memory (privvmpages) after a few hours.

    Now:

    I think that it is a either a problem with the new Virtuosso or it is a problem caused by the recompile for the security leak. It could be a problem between my code and the new environment.

    My vendor says that it is a problem with my code. The only stuff on this server are some applications intalled by Fantastico, some html stuff, and a couple of php scripts I wrote using an XML RPC library.

    My vendor tells me that the memory leak is my problem - which I think is far from clear.

    But, I cannot demonstrate the truth or falsity of this claim because I have been unable to determine the source of the memory leak.

    (I am a highly experienced and competent programmer, but, not in this environment)

    My vendor tells me there are no tools for diagnosing this.

    So, what I'd like is a suggestion of an approach to diagnosing this problem.

    Are there no utilities that can track memory allocations (by, time and script, or something) so that I can see what is going on.

    I've looked at top, but, I don't see anything that makes any sense to me.

    Does anyone have any suggestions of an approach to this problem?

    Thanks in advance for any suggestions.

    Geoff

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Hi Geoff,

    You might want to look for a more helpful host My initial reaction would be a problem either with Virtuozzo or their stup of it, as memory leaks are quite unlikely.

    Having said that, they are possible. Here are a few things I would start off with:

    1. Enable WHM > Shell Fork Bomb Protection . This will stop user processes and CGI scripts from consuming excessive server resources.

    2. When you run top, hit the M key to sort by memory usage. To get more information out of top, you can also do the following:

    c
    s
    2[enter]
    W


    Note, there's only one hit of the enter key in the above. The c turns on the commands being issues for each process. The s 2 [enter] tells top to scan every 2 seconds and the W writes those settings to disk.

    If nothing seems apparent, you can get detailed memory information on current processes using:

    ps axfvwww

    You could also install the sysstat rpm (if you're running a flavour of RedHat, which you probably are) and thgen use the sa utility to look for high memory usage. Not played with it myself, but it provides process resource usage information.

    However, if the memory leak is with the VPS itself, none of this will show anything. Feel free to PM me if you'd like me to take a peek.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    One more thing, just incase it is apache related, you should also run WHM > Modify Apache Memory Usage which will set a cap on the amount of memory and CPU that apache can use.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. Tomcat Memory Leak ...
    By furquan in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-27-2011, 01:33 PM
  2. Memory leak?
    By Jackster in forum New User Questions
    Replies: 2
    Last Post: 11-13-2010, 02:03 PM
  3. Clamd Memory Leak
    By MrCoal in forum E-mail Discussions
    Replies: 3
    Last Post: 02-15-2009, 02:35 PM
  4. mailman memory leak?
    By akox in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-23-2006, 01:52 AM
  5. Poss memory leak ?
    By fuzioneer in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 02-17-2006, 03:40 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube