Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (582)
games submitted by our members
Games in WIP (503)
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  
  java_arguments for applets on OS X problem  (Read 2233 times)
0 Members and 1 Guest are viewing this topic.
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Posted 2010-05-26 17:56:19 »

I pass -Xmx256m as java_arguments to the applet. That works fine on all systems, except on OS X.
Most poor apple users have versions below update10 - I know that it does not work there - but what about the other lucky 10% who have a higher Java version?
I searched a lot and did not find a solution. Then there is the mighty Minecraft. The java_arguments of the applet tag for Markus' game look pretty similiar to mine (except that there is a capital M used: -Xmx800M, I tried that too: fail).
Or has an applet to be signed on OS X to profit from java_arguments ?

bonus question:
why is java performance so overwhelmingly crippled on OS X (no, I don't use LWJGL) ?

lots of sillystupid games: http://www.emaggame.com
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #1 - Posted 2010-05-28 12:23:02 »

sorry to BUMP  persecutioncomplex
but I'm helpless.
Can someone tell me why OS X ignores my -Xmx?
Mac users of the world! please click my sig and press F2, this shows the used and maximum ram.
On Win&Linux max is about 247, OS X 's max is at most about 90 (I think the default value)

lots of sillystupid games: http://www.emaggame.com
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #2 - Posted 2010-05-28 21:15:07 »

its my understanding (could be wrong) that only the java plugin2 support jvm arguments. On mac you need to enable java plugin2 by selecting out of process applets from the java control panel.

However for java plugin1 apple have backported some features to allow stuff like javafx to work, however I'm not sure if the jvm argument support was also backported, its unlikely it was.

By default (atm) safari and firefox use the java plugin1 (unless changed in the java control panel) and chrome uses (and only supports) java plugin2.


Apple have also recently crippled java performance on mac (when using java plugin2), this was done as they are trying to better integrate java applets with the web page, to allow other html stuff to overlap the applets they render the graphics offscreen and then draw it using their own CoreGraphics api. This does make the applets fit better but kills performance. You can read more about it in the change log here, this change not only crippled java applets performance (including stuff like pulpcore) but also broke lwjgl and jogl applets.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #3 - Posted 2010-05-28 22:15:10 »

Wow, thanks a lot kapta.
That makes me feel like this guy:
http://www.youtube.com/watch?v=w8vqSJAOC7I

Seems like the only solution is a webstart link for apple boys?

lots of sillystupid games: http://www.emaggame.com
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #4 - Posted 2010-05-28 22:21:04 »

Seems like the only solution is a webstart link for apple boys?

could also try a pop out JFrame if you still want to use applet.
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #5 - Posted 2010-05-28 22:27:42 »

could also try a pop out JFrame if you still want to use applet.
But that gives me no jvm arguments (I need more ram)

lots of sillystupid games: http://www.emaggame.com
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #6 - Posted 2010-05-28 22:59:37 »

Well surely your game can't be using that much ram (or need to) at any one given time. Maybe you can optimise it to unload resources that are no longer needed for a certain level and reload them when needed or other tricks to make it use less ram.

There is always the secret method to store an unlimited amount of stuff in ram with applets (i.e. no limit) using the AppletContext.(set/get)Stream method, however not sure it'll be useful enough for realtime, might work if you switch stuff between levels though (credit to Riven for discovering this).
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #7 - Posted 2010-05-28 23:44:59 »

That makes me feel like this guy:
http://www.youtube.com/watch?v=w8vqSJAOC7I

I was laughing tears

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #8 - Posted 2010-05-31 19:03:34 »

Well surely your game can't be using that much ram (or need to) at any one given time. Maybe you can optimise it to unload resources that are no longer needed for a certain level and reload them when needed or other tricks to make it use less ram.

There is always the secret method to store an unlimited amount of stuff in ram with applets (i.e. no limit) using the AppletContext.(set/get)Stream method, however not sure it'll be useful enough for realtime, might work if you switch stuff between levels though (credit to Riven for discovering this).
There is not much to do about the ram usage. 85% are used in int[], there is a rather high fix cost in my engine. One 960*600 image takes up 2,25m and I use several of them as buffers plus the model data. Each level all the images for the entities  are re-rendered (because of different resolutions of the levels) and discarded afterward. Maximum used ram after gc'ing is about 45m. I produce extreme amounts of garbage e.g. 4*2.25m for blurring the channels of a pic, but it runs smoothly with about 70m. I could rewrite lots of stuff to use less ram but it is just not worth it. 100m or even 256m is nothing today (my Eclipse atm uses 400m). On macs - I don't know what is happening there - the game crashes even with 90m available. I don't have a mac to profile what is going on there, so I just keep hating macs Smiley

lots of sillystupid games: http://www.emaggame.com
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #9 - Posted 2010-05-31 19:30:22 »

Hi, I do a bit of applet Dev on Mac (snow leopard).

A few notes that I have found.

while loops are EVIL!!!!!. try use "for" instead when it is most logical.
if you use a small while loop (calculation time) you will need to make a call to Thread.sleep(1); to prevent your applet from using 100% of a single CPU.
this can still happen with for loops, yet i find its less likely.

BufferedImage (maybe Image aswell) doesnt release itself from ram (yet it isnt classified as a memory leek).
instead of creating a whole new BufferedImage, try use setData(raster) instead.

Im not sure if this is also true for 32bit java

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #10 - Posted 2010-05-31 19:50:04 »

BufferedImage (maybe Image aswell) doesnt release itself from ram (yet it isnt classified as a memory leek).
instead of creating a whole new BufferedImage, try use setData(raster) instead.
this would explain a lot. But what do you do if [all] images have different sizes? I need a mac...

lots of sillystupid games: http://www.emaggame.com
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 (72 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (220 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!