Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (525)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (594)
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  
  OutOfMemory errors  (Read 1429 times)
0 Members and 1 Guest are viewing this topic.
Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Posted 2004-08-30 23:53:26 »

I only get out of memory errors on really big resolution running machines because at times I need to hold two buffers of the screen at a time.  Maybe I can do better than that, so I think I'll ask about that too...  So I figure if a machine is running a resolution higher than 1152x864 it should have a good amount of ram, so I should be able to hold those buffers without too much worry of running out of memory.  However at times I get OutOfMemory exceptions, so I think I need to increase the heap.  How can I do this when running a jar locally or running a jar through Webstart?

Second, I'll ask about the reason why I'm using so much memory.  In my game I want to fade when opening or closing a menu, but I've found that simply rendering the two, and the top one with a diminishing AlphaComposite, takes a long time.  If I hold two arrays of ints for the two menu's, and combine them myself, and use a custom class to throw that to the screen, it's MUCH faster, in every case I've tried.  However... this means I hold a lot of stuff.  For one, I hold two arrays of the dimensions of the screen, and I also hold on to the two BufferedImages those guys origionate from since it's faster to just draw over them when I need to than to recreate them whenever I open/close a menu.  But that means on a 2400x1600 resolution display (which I've been testing with), assuming 4 bytes per pixel in my two arrays and the two BufferedImages, that's 60 megs I have to grab just to open or close a menu.  That's a freaking lot.  Any suggestions for an alternate method to fade my screen quickly?  The limit here is Java2D.  Thanks!

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline kevglass

« JGO Spiffy Duke »


Medals: 210
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2004-08-31 04:23:38 »

Max heap in webstart -

<j2se version="1.3+" inital-heap-size="64m" max-heap-size="256m"/>

You can't do it from the manifest of a jar. You'd need to specify it on the command line.

Kev

Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #2 - Posted 2004-08-31 13:14:21 »

ok and how would I do that from the command line?

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »


Medals: 210
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2004-08-31 13:35:06 »

java -Xmx256m -Xms64m etc..

Kev

Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #4 - Posted 2004-08-31 15:57:06 »

I ran:
java -jar rimscape.jar -Xmx800m -Xms512m
and still got the same OutOfMemory exception at the same place... sooo... I think having enough memory available isn't the problem.

Any suggestions for how I can manage screen fading better?

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline kevglass

« JGO Spiffy Duke »


Medals: 210
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2004-08-31 16:15:12 »

I believe the -X parameters have to be the first on the command line to take any effect. Otherwise they get passed into the program as arguments rather than going into the VM..

Kev

Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #6 - Posted 2004-08-31 18:36:45 »

That seems to have done it, thanks a lot!

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
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.

toopeicgaming1999 (71 views)
2014-11-26 15:22:04

toopeicgaming1999 (60 views)
2014-11-26 15:20:36

toopeicgaming1999 (14 views)
2014-11-26 15:20:08

SHC (27 views)
2014-11-25 12:00:59

SHC (25 views)
2014-11-25 11:53:45

Norakomi (31 views)
2014-11-25 11:26:43

Gibbo3771 (25 views)
2014-11-24 19:59:16

trollwarrior1 (38 views)
2014-11-22 12:13:56

xFryIx (77 views)
2014-11-13 12:34:49

digdugdiggy (55 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!