Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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  
  Not enough memory  (Read 1702 times)
0 Members and 1 Guest are viewing this topic.
Offline m77

« In padded room »

« Posted 2011-07-12 08:09:25 »

i run a console application from command line
i have debug output:
1  
2  
3  
          Runtime rt = Runtime.getRuntime();
          System.out.println(""+i+" max:"+rt.maxMemory()+" free:"+
              rt.freeMemory()+" total:"+rt.totalMemory());


i've discovered playing with the last command line parameter "java poker77.v1.B2Test -J-Xmx10m" that it does not effect
help please
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2011-07-12 08:26:22 »

Try:
1  
java -Xmx10M poker77.v1.B2Test


 Wink

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline m77

« In padded room »

« Reply #2 - Posted 2011-07-12 09:01:17 »

Thank u, Riven
maybe somebody knows how to expand memory for NetBeans IDE?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Dx4

Junior Member


Medals: 5



« Reply #3 - Posted 2011-07-12 09:26:02 »

Thank u, Riven
maybe somebody knows how to expand memory for NetBeans IDE?

Right click project, go properties

Click on Run

add -Xmx10M to vm options, click ok

HTH
Offline cylab

JGO Ninja


Medals: 43



« Reply #4 - Posted 2011-07-12 16:20:54 »

If you _really_ want to change this setting for IDE itself (NOT for your applications you code in it), go to the <NetbeansInstallDir>/etc and edit the netbeans.conf file.

Mathias - I Know What [you] Did Last Summer!
Offline m77

« In padded room »

« Reply #5 - Posted 2011-07-13 09:33:44 »

i've been playing with options
the debug output is different for different options:
max:1013 free:97 total:271
and
max:506 free:96 total:271

but free memory is practically equal

any suggestions?
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #6 - Posted 2011-07-13 09:50:01 »

i've been playing with options
the debug output is different for different options:
max:1013 free:97 total:271
and
max:506 free:96 total:271

but free memory is practically equal

any suggestions?
The free memory is inside the total memory currently available, which is 271. Both time you ran your application, it used nearly the same amount, 174-175 bytes. You are only setting the maximum memory the JVM will attempt to use, which doesn't affect the total memory currently given to the JVM.

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #7 - Posted 2011-07-13 09:50:15 »

'free' is the amount of memory unused in the current heap (size = totalMemory)

if you want to get how much memory can still be allocated:
1  
2  
long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
long available = Runtime.getRuntime().maxMemory() - used;

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
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.

TehJavaDev (16 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (35 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (32 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (44 views)
2014-08-09 21:09:32

BurntPizza (35 views)
2014-08-08 02:01:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!