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
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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With