I bet you have a permgen leak in your application by Nikita Salnikov

10

Click here to load reader

Transcript of I bet you have a permgen leak in your application by Nikita Salnikov

Page 1: I bet you have a permgen leak in your application by Nikita Salnikov

I bet you have a memory leakNikita Salnikov-Tarnovski

@iNikem

Saturday, June 29, 13

Page 2: I bet you have a permgen leak in your application by Nikita Salnikov

Plumbr

• We solve memory leaks ... for now• Giving you the exact location of the leak with enough

information to fix it• The foundation is based on machine learning• Ongoing effort

Saturday, June 29, 13

Page 3: I bet you have a permgen leak in your application by Nikita Salnikov

Plumbr

• trained on 1,000,000 memory snapshots • From 5,000 different applications• Finding 88% of the existing leaks.• 30,000 monthly unique visitors on our site• 500 monthly downloads• 2600+ leaks discovered

Saturday, June 29, 13

Page 4: I bet you have a permgen leak in your application by Nikita Salnikov

Memory leak

• A situation where some objects are not used by application any more, but GC fails to recognize them as unused

• The notion of “object is not used by application any more” is totally, absolutely, 100% application specific!

http://plumbr.eu/blog/what-is-a-memory-leak

Saturday, June 29, 13

Page 5: I bet you have a permgen leak in your application by Nikita Salnikov

Classloader leak

• The most common leak in web applications • If even 1 class is left behind, he keeps all his friends• After some redeploys, you crash

Saturday, June 29, 13

Page 6: I bet you have a permgen leak in your application by Nikita Salnikov

Should you care?

• PermGen will die soon• Metaspace do not eliminate the problem

• No redeploy, no problem• Yeah, but...

Saturday, June 29, 13

Page 7: I bet you have a permgen leak in your application by Nikita Salnikov

Boy scout rule

Saturday, June 29, 13

Page 8: I bet you have a permgen leak in your application by Nikita Salnikov

The problem is...

• Most of the classloader leaks you will ever encounter are not your fault

• Libraries• You have no idea what do you use in your application

Saturday, June 29, 13

Page 9: I bet you have a permgen leak in your application by Nikita Salnikov

Demo

• Quite simple web application • CRUD with JPA, Spring, JSP, WebSockets• Running on Jetty

Saturday, June 29, 13

Page 10: I bet you have a permgen leak in your application by Nikita Salnikov

Solving performance problems is hard. We don’t think it needs to be.

Saturday, June 29, 13