This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Howdy. I've been doing some tweaks to an app hear at work. BTW, my app is served from 1 machine and not a product that we sell, so however it works on our app server is how it works. I also know all about System.gc() is just a request, not a guarantee. Anyhow, I noticed that if I put the call to System.gc in part of my code, when the app starts up I have about 10 megs more of memory freed up than with not doing it. My question is, am I suffereing too much of a performance hit to use GC at this point to only save 10 megs?
"too much" is a very vague term. too much for what? if you have 2k of free memory without doing it, and 10.002Meg of free memory with it, then i'd say probably not (although you probably have other issues). how important is performance to this app? will somebody die if it takes it an extra millisecond? are there other places where performance is being effected? I don't think there's really enough info in your post to give ANY kind of answer. you may want to look at some of the profiling tools available, and actually measure performance under different conditions.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors