Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1109535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:15:02+00:00 2026-05-17T02:15:02+00:00

I think I may have a memory leak in my LAMP application (memory gets

  • 0

I think I may have a memory leak in my LAMP application (memory gets used up, swap starts getting used, etc.). If I could see how much memory the various processes are using, it might help me resolve my problem. Is there a way for me to see this information in *nix?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:15:03+00:00Added an answer on May 17, 2026 at 2:15 am

    Getting right memory usage is trickier than one may think. The best way I could find is:

    echo 0 $(awk '/TYPE/ {print "+", $2}' /proc/`pidof PROCESS`/smaps) | bc
    

    Where “PROCESS” is the name of the process you want to inspect and “TYPE” is one of:

    • Rss: resident memory usage, all memory the process uses, including all memory this process shares with other processes. It does not include swap;
    • Shared: memory that this process shares with other processes;
    • Private: private memory used by this process, you can look for memory leaks here;
    • Swap: swap memory used by the process;
    • Pss: Proportional Set Size, a good overall memory indicator. It is the Rss adjusted for sharing: if a process has 1MiB private and 20MiB shared between other 10 processes, Pss is 1 + 20/10 = 3MiB

    Other valid values are Size (i.e. virtual size, which is almost meaningless) and Referenced (the amount of memory currently marked as referenced or accessed).

    You can use watch or some other bash-script-fu to keep an eye on those values for processes that you want to monitor.

    For more informations about smaps: http://www.kernel.org/doc/Documentation/filesystems/proc.txt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I may have misunderstood something here... But here goes. I'm using the
Similar to the known memory leak issue regarding creating and destroying an instance of
I'm diving into iOS development and am getting familiar with the tools. At the
I have a problem playing a sound correctly in Java using the Clip interface.
Hello stack overflowers, I have a desing that uses the flyweight pattern to share
I've tried searching for this but it's pretty difficult to put into words. Basically,
I am runing .net code on a machine with the page file size set
I am having a very strange behavior in JBoss, and I'd like avail myself
Is it useful to write a standardised TDD [Test] method that would expose common
I'm new to Java and really need your help. I am presently using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.