Let's say I hv a Java app which does roughly the below:
Initialize (takes a big time becoz this is complicated)
Do little stuff quickly
Wait idly for a big time (your favorite mechanism here)
Go to step 2.
do you know approach to encourage or force the JVM to flush it is memory out to disk during big periods of idleness? (e.g. at the end of step 2 make little function call that effectively tells "HEY JVM! I am going to be going to sleep for a while.")
I do not mind using a big chunk of virtual memory but physical memory is at a premium on the computer I am using becoz there're various background processes.