Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

usage a memory in processing

 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recently, I am testing the program for performance. However, the program is taking lots of memory than expected in processing.
Thus, I tried to use min/max heap memory in run command. it's still taking the memory about 300MB or 350MB.

Please advice anything what I need to check or test with something else.. or what problem with the program.

welcome any comments.

regards,
 
Campbell Ritchie
Sheriff
Posts: 48440
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know myself, but other people have had rather similar problems recently. Look here, and here, and here, and here. I hope there aren't too many duplicates amongst those links. See whether any of them is of any use to you.
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, Campbell!
I trying to see the freemeory before clear() and after use System.gc().

1. I wonder whether the application(program) use System.gc() in processing

if the program is holding the memory in processing until complete, how do I check and what I can verify the processing to release the memory.

many thanks,
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need to call System.gc() and you should not do so, in 99.9% of cases.

The system will never throw OutOfMemoryError when GC could free enough memory to service a request for memory.

The JVM's decisions about resizing the Java heap (if you have it configured to be resizable) are based on the true amount of memory used, not dead memory that has not been GCd yet.
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, got it.
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, got it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic