Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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 1417 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

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


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

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


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.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (52 views)
2014-04-15 18:08:23

BurntPizza (49 views)
2014-04-15 03:46:01

UprightPath (64 views)
2014-04-14 17:39:50

UprightPath (46 views)
2014-04-14 17:35:47

Porlus (63 views)
2014-04-14 15:48:38

tom_mai78101 (88 views)
2014-04-10 04:04:31

BurntPizza (147 views)
2014-04-08 23:06:04

tom_mai78101 (244 views)
2014-04-05 13:34:39

trollwarrior1 (203 views)
2014-04-04 12:06:45

CJLetsGame (210 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!