Show Some Love

Java: flushing memory out to disk

This forum was posted on Monday, May 27, 2013 5:50:34 AM

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.

107 Viewed this Question

 Recent Replies on "Java: flushing memory out to disk"

  • Nobody has replied on this post, be first to post answer.

Post Your Solution for this Question

Note: Please Put Code into <code></code> block.

Threads related to "Java: flushing memory out to disk":

How do I blur an image?

I'm trying to manipulate a blurring mechanic on a java game. How do I generate a blur effect on runtime?

When to use a List over an Array in Java?

In Java when would it be preferential to use a List rather than an Array?

Is Hadoop right for running my simulations?

have written a stochastic simulation in Java which loads data from a little CSV files on disk (totaling about 100MB) and writes o/p to other o/p file (not much data just a boolean and a little numbers). There is also a parameters file and for various parameters the distribution of simulation outputs would be expected to change. To find the correct/best input parameters i require to run multiple simulations across multiple input parameter configurations and appear at the distributions of the o

Mail for Blackberry's - multiple content attachments

We'd like to send a single email which has "multiple contents" attached. Scenario is that we'd like one content to be displayed if the email is read using a Blackberry and other content displayed if the email is read in a desktop email member. (Blackberry content would be just text other devices should read the HTML content Rather)I'm off to do little research but I wondered if anyone could tell me if this just doesn't sound possible.Muddled illustrationMail content 1 = text/plain

Calculate SHA1 or MD5 hash in iReport

How would one calculate an SHA1 or MD5 hash within iReport at report execution? i require to compare a pre-calculated hash against a database driven field (string).Using iReport 2.0.5 (Old) and Report Engine is embedded into a commercial application.

Better way to write this Java code?

public void handleParsedCommand(String commandArr) { if(commandArr0.equalsIgnoreCase("message")) { int target = Integer.parseInt(commandArr1); String msg = commandArr2; MachatServer.sendMessage(target this.conId msg); } else if(commandArr0.equalsIgnoreCase("quit")) { // Tell the server to disconnect us. MachatServer.disconnect(conId); } else if(commandArr0.equalsIgnoreCase("confirmconnect")) { // Blah blah and so on for other 10 types of command } else { try { ou

Servlet “newspring” is not available

trying to set up a new spring project and I'm getting this issue where I get this error (HTTP Status 404 - Servlet newspring is not available) when I navigate to a page that I expect to get routed through to a controller.web.xml springapp org.springframework.web.servlet.DispatcherServlet 1 springapp /app/* So I looked in the tomcat logs and I see this exception: SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.ap

In Groovy SwingBuilder, how do I attatch a closure to a JTable that fires when a cell is selected?

I hv a JTable being constructed via Groovy's SwingBuilder. i wish to attach a closure to the table that fires when a cell is selected but I can not appear to find the right hook.How do I do that?

Creating temporary JMS jms topic in Spring

I'm trying to refactor little legacy code snippet snippet to use Spring to handle the jms connections to a mainframe service. i require to connect generate a temporary topic for the mainframe service reply and set that as the msg.setJMSReplyTo(replyTo); in the msg before I send the msg.Can anyone provide examples of this? I hv not found anything in the documentation that allows you to get to the low level jms objects such as the session or TopicConnection in order to generate a temporary topic.

Android - Tabs, MapView, activities within tabs

We're in the process of writing an app that has 4 tabs: Map People Places Events. The People Places and Events in the app show up as Icons on the map. By default the People Places and Events tabs each show a listview custom rendered displaying all the People Places and Events respectively.Now right now each of the tabs has as it's content an Intent set to launch the corresponding activity. For instance There is a MapTabActivity that extends MapActivity a ShowPeopleL