How to analyze actual memory usage in Java App Engine?

I have a Java App Engine application that runs on automatically scaled F1 instances (600 MHz, 128 MB RAM). After a warm-up, memory usage per instance, shown by the dashboard, is about 220 MB. According to docs , this includes "runtime overhead".

  • Is it possible to assume that this number reflects the maximum size of permg and heap, but not necessarily actually used? I never got an error from memory.
  • What is the best way to analyze memory usage in a production environment? Is there a way to execute heap heaps despite App Engine runtime limitations?

Local analysis using, for example, VisualVM does not provide an accurate image, since it includes a development server, versions of Datastore and Memcache in memory, etc. In total, it includes up to 8,000 loaded classes (including a dev server, my own classes and about 85 libraries), a resulting capacity of 50 MB and a minimum heap size of 50 MB after a complete garbage collection.

Some background to my question: sometimes the scheduler (often during the first few requests after completing the usual synchronization task) starts a new instance to process the load of the request, which is usually processed by only one instance. After several requests, all requests will be completely and consistently redirected to the first instance. Based on the set of scheduler rules described here , I'm trying to figure out if this could be due to the scheduler predicting the (temporary) lack of instance memory to handle additional requests.

+6
source share
1 answer

What is the best way to analyze memory usage in a production environment? Is there a way to do a bunch of dumps despite App Engine runtime limitations?

There is no good way. Toolkit is not supported.

0
source

Source: https://habr.com/ru/post/969634/


All Articles