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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...