Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CF memory usage by cf app command

I want to understand memory status reported by cf app command. e.g. If for my app it returns

 state     since                    cpu     memory       disk           details

0 running 2017-02-11 08:06:39 AM 18.2% 2.2G of 4G 200.3M of 1G

What does this 2.2G means really? Because when I see my application in newrelic it shows like ~1GB being used. I believe actual allocation will also depend on some other parameter (xmx, memory calculatros?) when application starts.

(It is spring boot application)

like image 660
user3444718 Avatar asked Oct 22 '25 01:10

user3444718


1 Answers

When you run cf app <app-name>, the output shows the memory and CPU usage that is reported by the Linux Kernel for your container. Recent versions of CF obtain this using Guardian & runc, older versions using Warden.

Conceptually you can think of what it's reporting as the memory usage for all processes running inside the container. This includes your application processes, but also a couple very small processes put there by the platform (one being the SSH daemon that facilitates cf ssh). If you want to see more about what's running in your container, I would suggest executing cf ssh and then looking at ps aux or top.

In regards to your specific app, the difference that you're seeing is likely due to the fact that it's a Java app. You need to make sure that you're looking at the full memory usage for the process and not just the heap usage. Heap is only one part of the total memory usage for a Java app, which also includes PermGen (1.7) or Metaspace (1.8), threads, native code, direct memory and other memory used by the JVM itself.

like image 155
Daniel Mikusa Avatar answered Oct 27 '25 06:10

Daniel Mikusa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!