Jump to content
  • 0

Finding Memory Leak


Question

Posted

Hello, as title says, i would like to know how to test server, to find a memory leak. Basically i can see that RAM usage is growing hourly with the same amount of players.

Please, ignore your opinion about my java knowledge if i will be able to find it and fix it or not, first of all i want information how to gather information about memory leak.

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

Enable Eclipse warnings about the memory leak and you will see yellow triangles / msg on warnings tab.

 

 

You don't have to worry about memory leak until you get an error about that. More memory you allocate, more RAM will be in use - garbage collector will be "launched" later.

 

 

Allocate 512mo and see how long does it take to clean/decrease the ram usage. Rise up to 1/2G and you will notice that the ram usage is bigger and the time increases as well.

You can open VisualVM, it comes with jdk, so you can find it under JDK directory. You will have a diagram/graph with ram usage and much more. You could catch eventual memory leak.

 

 

In short, you don't have to worry, it's normal :)

 

 

PS: Correct me if I melted something :happyforever:

Edited by SweeTs
  • 0
Posted

About RAM usage, it should up and down following GC cycles. If you got accumulating memora consumption, yup you got memory leak. But if after hours and hours your program is still up, with similar cycles, then you got no leaks.

 

VisualVM as SweeTs said, which is packed with JDK, allows to see cycles and general consumption.

 

"C:\Program Files\Java\jdk1.8.0_25\bin\jvisualvm.exe"

  • 0
Posted

About RAM usage, it should up and down following GC cycles. If you got accumulating memora consumption, yup you got memory leak. But if after hours and hours your program is still up, with similar cycles, then you got no leaks.

 

VisualVM as SweeTs said, which is packed with JDK, allows to see cycles and general consumption.

 

"C:\Program Files\Java\jdk1.8.0_25\bin\jvisualvm.exe"

 

 

Enable Eclipse warnings about the memory leak and you will see yellow triangles / msg on warnings tab.

 

 

You don't have to worry about memory leak until you get an error about that. More memory you allocate, more RAM will be in use - garbage collector will be "launched" later.

 

 

Allocate 512mo and see how long does it take to clean/decrease the ram usage. Rise up to 1/2G and you will notice that the ram usage is bigger and the time increases as well.

You can open VisualVM, it comes with jdk, so you can find it under JDK directory. You will have a diagram/graph with ram usage and much more. You could catch eventual memory leak.

 

 

In short, you don't have to worry, it's normal :)

 

 

PS: Correct me if I melted something :happyforever:

Thank you bouth.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock