JVM GC logging from AWS Lambda?

java garbage-collection aws-lambda

560 просмотра

3 ответа

1250 Репутация автора

Can anyone suggest an applicable strategy for logging GC events from within AWS Lambda execution?

I am looking into something as close as possible to -XX:+PrintGC kind of logging, but since I can't really send any startup parameters to the lambda JVM process, it seems like the only way is by live JMX introspection? If that is the only way, any library or standardized approach applicable for AWS Lambda (tools that depend on running process, like VisualVM are unfortunately out of question)?

Автор: Milan Aleksić Источник Размещён: 19.07.2016 07:54

Ответы (3)


-2 плюса

561 Репутация автора

Use jvisualvm in the jdk bin directory. It's an excellent tool

Автор: Just another Java programmer Размещён: 19.07.2016 07:57

1 плюс

6068 Репутация автора

Решение

I'm not familiar with AWS Lambda, but if you are looking for JMX introspection you can find code example by link below.

https://github.com/aragozin/jvm-tools/blob/master/sjk-core/src/main/java/org/gridkit/jvmtool/MBeanGCMonitor.java

Unfortunately, JMX information isn't as rich as GC logs, but some information such as per generation memory dynamics are available.

Автор: Alexey Ragozin Размещён: 21.07.2016 06:03

1 плюс

1974 Репутация автора

It does not work with all available arguments, but you can set the JAVA_TOOL_OPTIONS environment variable in your AWS lambda to pass such flags. For example, I'll often pass "-verbose:class" to debug poor cold start performance.

Автор: tgoodhart Размещён: 06.04.2018 04:43
Вопросы из категории :
32x32