views:

43

answers:

4

We are putting together a platform that can supposedly load any jar file and run statistical models. The issue im facing right now is that some models run too big to fit on our platform causing heap out of memory errors. I know there has been research done on this but I cant find them anymore. In essence, how does google app engine do this? Has anybody heard of any disk based heap space?

A: 

You can use command line switches to increase heap space (generally up to 2GB).

If thats not enough then you'd need to carefully tune your apps memory usage, which would require more info regarding its design.

Visage
A: 

Disk based heap space is trivial - it's commonly called Virtual memory, and the process of moving data from disk to meory and back is known as swapping. Any OS designed in the last 3 decades can do it. It doesn't only work for the heap, but also for stacks, program memory itself, etc. It is quite slow though, and with modern memory prices often unnecessary.

MSalters
A: 

You can use these parameters for specifying the heap size

java -Xms1024m -Xmx2048m

The first one is the initial size and the second one is the maximum size. If there is no RAM to support this heap size, then the OS will automatically do pagination/swaps to accommodate this memory size. Of course, that would obviously be slower.

Bragboy
+1  A: 

I assume that you've already expanded your heap as much as is realistically possible (given the constraints of your physical memory, processor architecture, JVM and OS).

Beyond, that the answer is that no JVMs that I'm aware of implement disk based heap space. However, it is not a totally ludicrous idea. There once was a community of academics (mostly) working on the problem of "orthogonal persistence" where objects migrate transparently between memory and a persistent store. Unfortunately, there were some fundamental issues that made this technology ... hard. (For instance, garbage collecting the persistent store, getting logically consistent checkpoints with multi-threaded applications, and dealing with code change.) Anyway, the upshot is that field of research has gone quiet.

Stephen C
Thats too bad. I remember there was some research papers we had found prior but I cant seem to find them now. I guess this is a dead end.
fdlcruz