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 (289)
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  
  Applet can take more than 600m, -Xmx256m has set ? [SOLVED]  (Read 1122 times)
0 Members and 1 Guest are viewing this topic.
Offline Jari Särö

Junior Member


Medals: 1



« Posted 2011-06-22 13:00:23 »

Hello,

I have my applet " http://temp4322.dy.fi/AsiakasOhjelma.html ",
when i keep my applet running the memory of JAVA program rises 1m a second to well over 600m, i dont understand why this is possible as i have set my -Xmx256m to 256m ?

Why applet takes more memory what is set, i also has System.gc () at some points of my code, but it wont release the memory what Linux Mint 11 wants for JAVA, have i miss understood the -Xmx option ?

Offline Cero
« Reply #1 - Posted 2011-06-22 13:42:09 »

couls you just post your whole VM arguments string, all those parameters ?

maybe you just spelled soemthing wrong, and in that case it doesn't work.
And if I don't set the memory in my apps, the System outputs wrong memory numbers which are very high, its all screwed up then

Offline Jari Särö

Junior Member


Medals: 1



« Reply #2 - Posted 2011-06-22 13:46:10 »

here,

The Linux <applet> tag,

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
<div style="position:absolute;top:1%;left:1%;width:98%;height:97%;">
<applet code="main.Main"
codebase="http://bittipankki001.com/AsiakasOhjelma/"
archive="AsiakasOhjelma.jar"
width="100%"
height="100%">
<param name="separate_jvm" value="true">
<param name="java_arguments" value="-Xms32m -Xmx256m -Dsun.java2d.d3d=false -Dsun.java2d.opengl=true -Djnlp.packEnabled=true">
</applet>
</div>
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #3 - Posted 2011-06-22 13:53:06 »

Have you looked at your program, while it is running, with a profiler? JVisualVM.exe comes with Java and is quite good for tracking down memory leaks. It can be found in the JDK/bin folder.

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline Cero
« Reply #4 - Posted 2011-06-22 13:59:16 »

arguments string, seems fine

Have you looked at your program, while it is running, with a profiler? JVisualVM.exe comes with Java and is quite good for tracking down memory leaks. It can be found in the JDK/bin folder.

point is, even with memory leaks, a java program with max 256M should get a OutOfMemoryError way before 600M

I don't really work with applets though...

Offline princec
« League of Dukes »

JGO Kernel


Medals: 195
Projects: 3


Eh? Who? What? ... Me?


« Reply #5 - Posted 2011-06-22 14:21:24 »

That's just the Java heap it limits. The rest of the memory is "native" heap, stack, JVM itself, any mapped files, and direct bytebuffers, of which there are probably quite a few. And it might not all be physical RAM anyway, some of it's likely to be virtual.

Cas Smiley

Offline Jari Särö

Junior Member


Medals: 1



« Reply #6 - Posted 2011-06-22 14:54:41 »

Direct ByteBuffers,

I had the following line of code at my nio code, i had it nulled later, and at the start of my method it was installed again, i had forget it to inside a method, it is now on global area, it made my VM to collect garbage a bit less than 1M a second, sometimes it stopped the garbage collection, but started again later, i noticed the problem when my memory was running out, my VM still takes a small rise on memory requirements at times, but it is not that heavy problem anymore, my JAVA seems to take a some what a 109m currently, i keep my program running next nigth and check again tomorrow, thanks for pointing me this bytebuffer, i would not had found this line alone, thanks ..

1  
ByteBuffer buf = ByteBuffer.allocateDirect ( 2048 ) ;
Offline princec
« League of Dukes »

JGO Kernel


Medals: 195
Projects: 3


Eh? Who? What? ... Me?


« Reply #7 - Posted 2011-06-22 15:51:22 »

Yes, direct bytebuffers are meant to be used in specific ways. Generally you allocate one and expect it to remain allocated for a long long time.

Cas Smiley

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!
 
Get high quality music tracks for your game!

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 (60 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (175 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.109 seconds with 21 queries.