Link to home
Start Free TrialLog in
Avatar of Michael Lam
Michael Lam

asked on

how to tell memory useage of my app in a Mac

i am introducing caching to one of my apps (it calls various service methods to access data from DB), and i want to find out how much extra physical memory it takes.  i have tried the activity monitor and also this:

$ Ps -ef | grep dsp
716566150  3234  1070   0  5:41PM ttys000    1:43.18 /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -server -Xms128M -Xmx512M -XX:+HeapDumpOnOutOfMemoryError -XX:PermSize=128M -Dcom.sun.management.jmxremote -Ddsp-env=osgi -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:///dev/urandom -Djava.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/endorsed:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/endorsed:/Users/212353126/GIA150/dsp-k-1.5.0/lib/endorsed -Djava.ext.dirs=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/ext:/Users/212353126/GIA150/dsp-k-1.5.0/lib/ext -Dkaraf.instances=/Users/212353126/GIA150/dsp-k-1.5.0/instances -Dkaraf.home=/Users/212353126/GIA150/dsp-k-1.5.0 -Dkaraf.base=/Users/212353126/GIA150/dsp-k-1.5.0 -Dkaraf.data=/Users/212353126/GIA150/dsp-k-1.5.0/data -Djava.io.tmpdir=/Users/212353126/GIA150/dsp-k-1.5.0/data/tmp -Djava.util.logging.config.file=/Users/212353126/GIA150/dsp-k-1.5.0/etc/java.util.logging.properties -Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true -classpath /Users/212353126/GIA150/dsp-k-1.5.0/lib/karaf-jaas-boot.jar:/Users/212353126/GIA150/dsp-k-1.5.0/lib/karaf.jar org.apache.karaf.main.Main
716566150  3408  3182   0  5:59PM ttys004    0:00.00 grep dsp

but i am not sure what all the results mean.  for example, what is the memory usage?  is it possible to break the usage down to a finer level, e.g. by thread or service call?  also is there a way to log the usage?
SOLUTION
Avatar of Phil Phillips
Phil Phillips
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you just wanted %mem, you could just do that with ps.

ps -meo %mem -o command|more