Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Some sources about jvm memory allocation?  (Read 2206 times)
0 Members and 1 Guest are viewing this topic.
Offline Serethos

Junior Member




Java games rock!


« Posted 2008-07-24 15:45:03 »

I have recently ran into the problem to watch the memory behaviour of my application on a linux machine (more detailed a
vserver system with gentoo). I am really not too familiar with unix system, only having some good basics.
In difference to my experiences on windows machines the jvm on this linux machine seems to grab an enormous amount
of memory at startup even when it is only reserved but not used.

So even very small applications doing e.g. a Thread.sleep  are started from a jvm reserving some hundred mb of memory. A 'top'
ressource view of the machine shows that only a little part of that memory gets actually used. This leads to the problem that
memory is so fast wasted that there is no space for further jvms to be loaded.
I had some success limiting the memory with -xms/-xmx parameters. But nonetheless I never noticed such a behavour on
Windows machines.

So some links or ressources would be welcome, which describe the memory allocation behaviour of a freshly started jvm
and - if exists - the differences on the operating systems.
Offline jezek2
« Reply #1 - Posted 2008-07-24 15:57:42 »

It should not be that different. You're probably looking to virtual size, which is just how much virtual memory process can view, not about actual allocated memory (there can be mapped files, etc.). Look into RSS, which is better but also not accurate as it doesn't count swapped RAM (I think). Best is to measure real used memory by comparing listing of "free" command before and after you run your app. You must subtract/add buffers/caches to get real number (ie. mem used - buffers used = real used value, that you should compare).
Offline CommanderKeith
« Reply #2 - Posted 2008-07-25 08:35:43 »

It might be because the server VM is automatically used on linux, but not on windows which defaults to the client VM.

Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline Mr_Light

Senior Member




shiny.


« Reply #3 - Posted 2008-08-18 18:44:50 »

see http://java.sun.com/docs/hotspot/gc5.0/ergo5.html for defaults.

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (69 views)
2013-05-17 21:29:12

alaslipknot (79 views)
2013-05-16 21:24:48

gouessej (110 views)
2013-05-16 00:53:38

gouessej (105 views)
2013-05-16 00:17:58

theagentd (116 views)
2013-05-15 15:01:13

theagentd (105 views)
2013-05-15 15:00:54

StreetDoggy (150 views)
2013-05-14 15:56:26

kutucuk (174 views)
2013-05-12 17:10:36

kutucuk (171 views)
2013-05-12 15:36:09

UnluckyDevil (180 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.105 seconds with 20 queries.