Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @ExpectNoInflaterMemoryLeak #98

Open
jeanbisutti opened this issue Aug 3, 2020 · 5 comments
Open

Add @ExpectNoInflaterMemoryLeak #98

jeanbisutti opened this issue Aug 3, 2020 · 5 comments
Labels
jvm JVM annotations ✨ feature New feature or request

Comments

@jeanbisutti
Copy link
Collaborator

java.util.zip.Inflater can cause non-heap memory leaks, as explained in this presentation. They can be detected during the application execution thanks to the Leakchecker project. This issue aims to provide an @ExpectNoInflaterMemoryLeak annotation in QuickPerf to detect this memory leak as soon as possible. The @ExpectNoInflaterMemoryLeak will be based on the Leakchecker project. This project has an Apache 2.0 license so that it is ok to detect inflater memory leak in the same way in QuickPerf project. Both in QuickPerf source code and QuickPerf documentation, we will take care of mentioning the Leakchecker project.

This issue is focussed on memory leaks that could come from Inflater. Later, we could detect other kinds of potential memory leaks, such as those that could be raised from ObjectInputStream.

@jeanbisutti jeanbisutti added ✨ feature New feature or request jvm JVM annotations labels Aug 3, 2020
@jeanbisutti jeanbisutti added this to the 1.1 milestone Aug 3, 2020
Repository owner deleted a comment from navkumar258 Aug 4, 2020
Repository owner deleted a comment from navkumar258 Aug 4, 2020
@loicmathieu
Copy link
Contributor

Tomcat has a lot of memory leak protections since version 7: https://cwiki.apache.org/confluence/display/TOMCAT/MemoryLeakProtection

Maybe we can create multiple memory leak detection based on those examples. This could be a very cool addition to what quickperf already does!

@jeanbisutti jeanbisutti modified the milestones: 1.1, 1.2 Dec 18, 2020
@lhotari
Copy link

lhotari commented Dec 19, 2020

Btw. There is also Leak Canary from Square for detecting memory leaks. It's originally developed for Android apps, but there is some support for applying it for JVM apps: https://square.github.io/leakcanary/recipes/#detecting-leaks-in-jvm-applications . Perhaps some parts could be reused in QuickPerf?

@jeanbisutti
Copy link
Collaborator Author

I ignored that Leak Canary could work with a JVM app. It would be interesting to reuse the Leak Canary HeapAnalyzer in QuickPerf.

@jeanbisutti
Copy link
Collaborator Author

Information coming from interesting Twitter conversations about Leak Canary:

@jeanbisutti
Copy link
Collaborator Author

JFR may reveal some heap memory leaks with the help of the Old Object Sample event: http://hirt.se/blog/?p=1055

QuickPerf can trigger JFR profiling and retrieve JFR events.

However, the Old Object Sample event was introduced in JDK 10. So, the heap leak detection would only work from this JDK version.

@jeanbisutti jeanbisutti removed this from the 1.2 milestone Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jvm JVM annotations ✨ feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants