Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
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  
  Game "running out of memory" with 32-bit JRE's  (Read 2362 times)
0 Members and 1 Guest are viewing this topic.
Offline orange451

JGO Kernel


Medals: 346
Projects: 6
Exp: 6 years


Your face. Your ass. What's the difference?


« Posted 2017-07-15 21:48:27 »

My game is more on the graphically demanding side; It loads a lot of high resolution diffuse textures, normalmaps, specularmaps, and glossmaps. On 64-bit JRE's this is no problem. But I cant seem to allocate enough ram to get the game to boot with 32-bit ones.

This is my command line:
java -Xmx1024M -Xms1024M -jar client.jar

First Recon. A java made online first person shooter!
Offline Ecumene

JGO Kernel


Medals: 195
Projects: 4
Exp: 8 years


I did not hit her! I did not!


« Reply #1 - Posted 2017-07-16 00:16:49 »

Why can't you increase the memory allocated to the JVM?

Here's some code to modify the ram allocation on a machine that can support it.
1  
java -Xmx2G -Xms2G -jar client.jar

Change those numbers to your liking, but over 4 gigabytes the 32 bit JVM doesn't support it.

Also if you're using OpenGL, most assets are streamed into VRAM without a copy on the client side.. So unless you have a huge custom cursor icon, Textures and Images shouldn't be a RAM issue. ( I believe )

If you're concerned about things taking up too much memory, check out VisualVM. theagentd recommended it to me and it saved my life. It gives you detailed info about a Java programs memory.

Offline orange451

JGO Kernel


Medals: 346
Projects: 6
Exp: 6 years


Your face. Your ass. What's the difference?


« Reply #2 - Posted 2017-07-16 02:45:43 »

Increasing the ram doesn't seem to help. 32bit JRE still says there isn't enough memory.

On my friends computer (who has a 32 bit JRE), he is unable to allocate more than 1024 MB using the command line.

First Recon. A java made online first person shooter!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online CommanderKeith
« Reply #3 - Posted 2017-07-16 06:13:34 »

Seems to be a known problem:
http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_heap_32bit

Why can't I get a larger heap with the 32-bit JVM?

The maximum theoretical heap limit for the 32-bit JVM is 4G. Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G. On 32-bit Solaris kernels the address space is limited to 2G. On 64-bit operating systems running the 32-bit VM, the max heap size can be higher, approaching 4G on many Solaris systems.

As of Java SE 6, the Windows /3GB boot.ini feature is not supported.

If your application requires a very large heap you should use a 64-bit VM on a version of the operating system that supports 64-bit applications. See Java SE Supported System Configurations for details.

Offline theagentd
« Reply #4 - Posted 2017-07-17 07:20:57 »

Is there a specific reason why you want to support 32-bit JVMs?

Myomyomyo.
Offline princec

« JGO Spiffy Duke »


Medals: 974
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2017-07-17 08:33:58 »

I found that I was generally unable to allocate over 1GB of RAM with the 32 bit VM. I switched to 64-bit and never looked back. >95% of the worlds desktop computers are now 64 bit and rising, and it solves so many little niggly issues it's a no brainer.

Cas Smiley

Offline abcdef
« Reply #6 - Posted 2017-07-17 10:22:39 »

32 bit jvms need contiguous memory, so even if your system has a lot more free, if it is fragmented you still won't be able to use it. Your best bet is to shut everything down then open your app. Or best of all move to 64 bit where you don't have any limitations.
Offline princec

« JGO Spiffy Duke »


Medals: 974
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2017-07-17 12:26:21 »

Your best bet is to shut everything down then open your app
Back when I was dealing with this I would try that but generally it's at best an unreliable work-around and not gonna work for anyone else - the only real solution is as you say, move to 64 bit. Or figure out how to use a much smaller heap Wink

Cas Smiley

Offline orange451

JGO Kernel


Medals: 346
Projects: 6
Exp: 6 years


Your face. Your ass. What's the difference?


« Reply #8 - Posted 2017-07-17 17:12:18 »

Is there a specific reason why you want to support 32-bit JVMs?
Not at all. I don't want to. But almost half of everyone I send the game to has a 32bit JRE installed (on their 64bit OS's).

First Recon. A java made online first person shooter!
Offline princec

« JGO Spiffy Duke »


Medals: 974
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #9 - Posted 2017-07-17 17:23:09 »

Give 'em an embedded VM.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #10 - Posted 2017-07-25 13:47:41 »

Hi

If you really plan to drop 32-bit support, maybe you can include the JRE in your game, AdoptOpenJDK provides prebuild OpenJDK builds for numerous 64-bit operating systems including GNU Linux, Microsoft Windows and Mac OS X.

Julien Gouesse | Personal blog | Website | Jogamp
Offline nsigma
« Reply #11 - Posted 2017-07-25 14:01:46 »

If you really plan to drop 32-bit support, maybe you can include the JRE in your game, AdoptOpenJDK provides prebuild OpenJDK builds for numerous 64-bit operating systems including GNU Linux, Microsoft Windows and Mac OS X.

As do Azul at https://www.azul.com/products/zulu-and-zulu-enterprise/.  Has the benefit of being certified, which IIRC AdoptOpenJDK isn't?  Longer term I'd favour AdoptOpenJDK, but while they're not recommending it for production purposes, Azul's OpenJDK build might be a better option.

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline gouessej
« Reply #12 - Posted 2017-07-26 09:39:50 »

Both have pros and cons. AdoptOpenJDK isn't governed by a single corporation that might be tempted to provide only non free of charge builds in the future, it has several sponsors, it passes the OpenJDK test suite and some other tests designed by the community. Its aim isn't to provide formally certified builds, its maintainers advise to get them from commercial providers. Moreover, I'm trying to convince some maintainers to provide 32-bit binary builds for Intel. I don't want to encourage planned obsolescence.

Julien Gouesse | Personal blog | Website | Jogamp
Offline nsigma
« Reply #13 - Posted 2017-07-26 10:07:23 »

Both have pros and cons. AdoptOpenJDK isn't governed by a single corporation that might be tempted to provide only non free of charge builds in the future, it has several sponsors, it passes the OpenJDK test suite and some other tests designed by the community. Its aim isn't to provide formally certified builds, its maintainers advise to get them from commercial providers. Moreover, I'm trying to convince some maintainers to provide 32-bit binary builds for Intel. I don't want to encourage planned obsolescence.

We pretty much have the same viewpoint.  Just pointing out that while AdoptOpenJDK themselves emphasise it's "work in progress" it might not be the better option.  Longer term I hope it becomes the go-to option.

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline princec

« JGO Spiffy Duke »


Medals: 974
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #14 - Posted 2017-07-26 10:26:13 »

If it works then it works, as far as I'm concerned Cheesy I'm 100% behind AdoptOpenJDK.

Now if only there were JVMs that ran on PS4 and XBOne...

Cas Smiley

Offline gouessej
« Reply #15 - Posted 2017-07-26 11:56:30 »

Azul provides some installers, this is more convenient for non technical end users but it's useless for programmers who want to put the JRE into their own bundles.

Do a lot of your end users still use 32-bit Intel computers?

Julien Gouesse | Personal blog | Website | Jogamp
Offline princec

« JGO Spiffy Duke »


Medals: 974
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #16 - Posted 2017-07-26 12:04:55 »

For me, it's the Steam market, which last time I looked was under 5% of users still using 32-bit OSes and falling.

Cas Smiley

Offline nsigma
« Reply #17 - Posted 2017-07-26 13:10:59 »

Azul provides some installers, this is more convenient for non technical end users but it's useless for programmers who want to put the JRE into their own bundles.

They provide both!

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline gouessej
« Reply #18 - Posted 2017-07-26 14:41:59 »

Yes I know that but the installers aren't very useful without applet and Java Webstart, are they?

Julien Gouesse | Personal blog | Website | Jogamp
Offline Riven
Administrator

« JGO Overlord »


Medals: 1324
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #19 - Posted 2017-07-26 14:44:35 »

Applets and WebStart tech are dead, except in some intranet apps in companies that can't shed their legacy. Hardly relevant for JGO audiences.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline nsigma
« Reply #20 - Posted 2017-07-26 14:44:39 »

Yes I know that but the installers aren't very useful without applet and Java Webstart, are they?

Huh?!  Huh  I meant that both AdoptOpenJDK and Azul provide an OpenJDK JRE you can bundle - what's that got to do with the thankfully dead applet and webstart?!

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline gouessej
« Reply #21 - Posted 2017-07-26 15:19:00 »

AdoptOpenJDK doesn't provide any installer yet whereas Azul does but as AdoptOpenJDK and Azul don't use IcedTea Web, there is no implementation of applets and Java Webstart in their JREs. I just wonder how those installers could be really useful especially if the main interest of those JREs is to be bundled. They don't show nasty ads unlike Oracle ones but a non technical user who would install Azul Zulu or AdoptOpenJDK would lose Java Webstart.

Julien Gouesse | Personal blog | Website | Jogamp
Offline Riven
Administrator

« JGO Overlord »


Medals: 1324
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #22 - Posted 2017-07-26 15:30:01 »

And in the context of embedding a JVM (which is what this  thread is about), that really isnt relevant Pointing

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (110 views)
2017-09-30 02:57:34

theagentd (136 views)
2017-09-26 18:23:31

cybrmynd (245 views)
2017-08-02 12:28:51

cybrmynd (241 views)
2017-08-02 12:19:43

cybrmynd (240 views)
2017-08-02 12:18:09

Sralse (254 views)
2017-07-25 17:13:48

Archive (864 views)
2017-04-27 17:45:51

buddyBro (1008 views)
2017-04-05 03:38:00

CopyableCougar4 (1569 views)
2017-03-24 15:39:42

theagentd (1373 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!