LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-24-2011, 01:22 AM   #1
chuikingman
Member
 
Registered: Aug 2009
Posts: 91

Rep: Reputation: 16
monitor memory usage for process


Hi,
I use linux and Unix and I want to monitor the memory usage for process.
To prevent memory leakage and out of memory of the system.
Any command or sytnax , have more better and presentable data
than below command about memory usage of one process ??

ps -o %cpu,%mem,lstart,args,comm,cputime,pid,rss,vsz -p 10537

%CPU %MEM STARTED COMMAND COMMAND TIME PID RSS VSZ
0.8 10.6 Mon Jan 24 13:37:07 2011 /opt/j2sdk1.4.2_ java_executable 00:00:33 10537 111708 910044

any suggestion ??
 
Old 01-24-2011, 07:47 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
While this may sound obvious it might get you there in time to restart a process but monitoring memory usage does not prevent memory leaks: better coding may. Expecting the system to compensate for a user deciding to deploy a crappy coded .war file is like fighting symptoms instead of fighting the cause. Back to your question you could reinvent the wheel if that's what you're after or use existing tools like jconsole / jhat to check Java processes and say Monit for watching process memory and automagic restarting it?
 
Old 01-24-2011, 08:05 PM   #3
an15wn
LQ Newbie
 
Registered: Dec 2010
Location: Jakarta, ID
Distribution: Fedora, Ubuntu
Posts: 18

Rep: Reputation: Disabled
Hi chui,

I don't know what's your distro, mines are Fedora and Ubuntu.
I usually use htop for realtime process monitoring. Htop is text based, curse based application.
 
Old 01-24-2011, 08:14 PM   #4
chuikingman
Member
 
Registered: Aug 2009
Posts: 91

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by unSpawn View Post
While this may sound obvious it might get you there in time to restart a process but monitoring memory usage does not prevent memory leaks: better coding may. Expecting the system to compensate for a user deciding to deploy a crappy coded .war file is like fighting symptoms instead of fighting the cause. Back to your question you could reinvent the wheel if that's what you're after or use existing tools like jconsole / jhat to check Java processes and say Monit for watching process memory and automagic restarting it?
Can I only use general unix/linux command to observe and monitor the system.
Which command you suggest ??

---------- Post added 01-25-11 at 10:14 AM ----------

Quote:
Originally Posted by an15wn View Post
Hi chui,

I don't know what's your distro, mines are Fedora and Ubuntu.
I usually use htop for realtime process monitoring. Htop is text based, curse based application.
Can I only use general unix/linux command to observe and monitor the system.
Which command you suggest ??
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
monitor memory usage of a process in linux kgarg29 Linux - Software 2 09-02-2010 05:06 PM
how to programmatically monitor a process memory usage? thanhvn Programming 14 02-20-2009 01:15 AM
how to programmatically monitor a process memory usage? thanhvn Linux - Software 1 11-15-2005 08:44 PM
Process memory usage wombat53 Linux - Newbie 5 07-21-2005 07:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration