Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (575)
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  
  VM crash workaround!  (Read 1202 times)
0 Members and 1 Guest are viewing this topic.
Offline ewills

Junior Duke




Java skeletal animation systems rock!


« Posted 2004-12-14 21:12:35 »

I've recently discovered a nice workaround for the native VM crashes that seem to plague odejava when large numbers of objects are added to the system.  By adjusting the java thread stack size parameter (-Xss), one can dramatically increase the runtime stability of odejava.

I am running Windows XP on a p4 with 512M ram and a GeForce4 4600.

With -Xss512k (the default), I can add 762 spheres to the system without a native crash.
With -Xss1M, I can add 1517 spheres.
With -Xss2M, I can add 2663 spheres.

And explanation of the -Xss option can be found here:
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/java.html  
(old Java version but best description).

I hope this helps!  Cheesy
Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #1 - Posted 2004-12-21 21:03:22 »

Thats all fair and square...however

try adding a tower which is 15 blocks high and each "level" has 3 blocks going horizontally across the x axis and another going in the direction (either z or y, whichever...).

Heck, il even supply you the code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
private void initFacingBlocks() {
            for (int i = 0; i < NUM_OF_ROWS; i++) {
                  for (int j = 0; j < 3; j++) {                        
                        TextureState boxTS = TextureLoader.loadTexture("jmetest/data/texture/crate.png");
                        
                        Box box = new Box("Facing Box " + i + ", " + j, new Vector3f(),
                                    6, 2, 2);
                        box.setModelBound(new OrientedBoundingBox());
                        box.updateModelBound();
                        box.getLocalTranslation().x = 0;
                        box.getLocalTranslation().y = i * 10f;
                        box.getLocalTranslation().z = j * 4.2f - 4.2f;
                        box.setRenderState(boxTS);
                        towerNode.attachChild(box);
                        
                        SimplePhysicsObject obj = new SimplePhysicsObject(box, 20f);
                  }
            }
      }

      private void initLeftBlocks() {
            for (int i = 0; i < NUM_OF_ROWS; i++) {
                  for (int j = 0; j < 3; j++) {
                        TextureState boxTS = TextureLoader.loadTexture("jmetest/data/texture/crate.png");
                        
                        Box box = new Box("Left Box " + i + ", " + j, new Vector3f(),
                                    2, 2, 6);
                        box.setModelBound(new OrientedBoundingBox());
                        box.updateModelBound();
                        box.getLocalTranslation().x = j * 4.2f - 4.2f;
                        box.getLocalTranslation().y = 5f + (i * 10f);
                        box.getLocalTranslation().z = 0;
                        box.setRenderState(boxTS);
                        towerNode.attachChild(box);
                        
                        SimplePhysicsObject obj = new SimplePhysicsObject(box, 20f);
                  }
            }
      }


Set the NUM_OF_ROWS to 8, it works fine...10, works fine...however, when u go wild and put 15, it works...as long as they dont all have contact!

As soon as the top most blocks start touching...kabooom:

Quote

An unrecoverable stack overflow has occurred.


Thats all ODEJava says....It seems to be its nothing to do with the java stack, but rather with an internal limit somehow...

Ofcourse increasing the stack size doesn't help. It would only help on adding objects, not contact...

Is there a set number of contacts that can occur at any one given time?

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline ewills

Junior Duke




Java skeletal animation systems rock!


« Reply #2 - Posted 2004-12-22 17:35:21 »

Ugg... you could try World.setStepInteractions(int i).  I'm working on another (possibly related) native crash at the moment.  I'll post if I come up with anything.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2004-12-23 10:42:25 »

ODE does have stack limits.  I think it is possible to increase them at compile time, at least for the Windows DLL.  What platforms are you testing on?

I trust everyone here is using the DEBUG version?  It is much more helpful at solving nasty (and they are) native crashes.

Will.

Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #4 - Posted 2004-12-23 11:54:10 »

I am using windows for testing...but i dont want to limit to windows since i am using Java!  Cool

I am using the release version...il d'ld the debug now.

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline ewills

Junior Duke




Java skeletal animation systems rock!


« Reply #5 - Posted 2004-12-27 20:19:48 »

I am also using Windows and do not want to be limited to Windows either  Cheesy  I didn't see a debug native library on the download page.  Where can it be downloaded from?
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #6 - Posted 2004-12-29 23:50:38 »

I wasn't suggesting only developing for Windows Smiley, I use OS X personally but test occasionally on Windows.  Using *NIX debug ODE libraries produces handy debug messages to stdout, the Windows DLL has message boxes I think.

Grab the latest natives here:  https://odejava.dev.java.net/servlets/ProjectDocumentList?folderID=2191&expandFolder=2191&folderID=0 You should find that each download has both debug and release versions.

Don't forget if you update the natives, the .jars need updating as well.  This version is the latest: https://odejava.dev.java.net/servlets/ProjectDocumentList?folderID=2192&expandFolder=2192&folderID=2191

Will.

Offline ewills

Junior Duke




Java skeletal animation systems rock!


« Reply #7 - Posted 2005-01-02 00:29:03 »

Got it!  Thanks!
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.

Longarmx (33 views)
2014-10-17 03:59:02

Norakomi (25 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (26 views)
2014-10-15 16:18:58

TehJavaDev (50 views)
2014-10-14 00:39:48

TehJavaDev (50 views)
2014-10-14 00:35:47

TehJavaDev (40 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (74 views)
2014-10-11 22:30:10
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!