I have a program that needs to run at a roughly regular interval, forever and ever. I found the ScheduledExecutorService and noticed its scheduleAtFixedRate() method. There's a simple tutorial here.
My question is, if my program continues to run as it's meant to (about every 60 seconds until the end of time) is there anything that needs done to handle garbage collection if I use the above method? Do I need to shut down threads, etc? Should I run System.gc? I'm still getting used to Runnables.
At the moment I am using a while loop and thread.sleep(60000) to execute my task every 60 seconds. There's no garbage collection this way though, and after running for a couple days my program winds up using over 70% of the server's memory.
Thanks for any help you can give. I appreciate your time helping me with my newbie issue. This is essentially year 2 of my Java journey!