开发者

Research on banishing heap space issues?

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?


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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜