Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Remote garbage collection - is it necessary?  RSS feed

 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading this article http://www.javaworld.com/jw-09-2001/jw-0907-rmi.html on tips to accelerate RMI programming. In the section labeled RMI infrastructure settings, the author makes a comment that the forced RMI garbage collections were unnecessary.
Can anyone clue me in on how I can make that kind of assessment on our RMI application? I'd like to know if we can safely set the values of sun.rmi.dgc.client.gcInterval and sun.rmi.dgc.server.gcInterval to much higher values than the default value of 60s.
In simplest form- We have an activatable RMI server set whose clients are JSP pages. The JSP pages obtain remote references simply by calling the appropriate method in a separate Java class which lives in on the webserver and the object is returned.
For example, in the JSP page:
<%
RemoteServer rs = ServerFarm.getRemoteServer();
ScoreServer ss = ServerFarm.getScoreServer();
// etc.
%>
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you'd want to do here is play with the values and watch memory consumption -- heap allocations, in particular -- as you increase the interval.
I would test this value at increments of 15 seconds, with a interval range spanning from 30 to 240 seconds. This should help you profile garbage collection that is probably too aggressive out to a value that may or may not be too liberal. In all trials, you'll want to measure heap consumption and the total run-time of your trial. What you'll expect is high performance overhead and more free heap space than you really need on the 30 second interval, and better performance but more heap consumption at the 240 second test.
If you see no difference worth measuring between these trials, then your application doesn't make sufficient demand on your memory/CPU resources to care, and so the benefit of any tuning work would be nominal.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!