Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
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  
  <Newbie> - HUGE memory usage for small web app?  (Read 2279 times)
0 Members and 1 Guest are viewing this topic.
Offline kit

Senior Newbie

Doing 3D on a _global_ scale :-)

« Posted 2003-03-26 12:50:54 »

Hey guys - thanks for reading a newbie post.

I am fairly well-versed in Java, and new to Java 3D.  I have started a project to connect a 3D representation of the earth with information in a database.  Eventually, I want to have a zoom-able globe, where the user can select points and attach information to them.  The info will then be stored in a PostgreSQL db.

But all that I currently have is a small demo, with a spinning earth.  You can find it at

I can post the code if you like, but basically it is from the texture tutorial (chapter 6) with the most recent version of Java 3D.  I have changed the code to work on a web site (ie, loading the file from a URL rather than a file object), made the display size a bit bigger, and switched in a higher resolution JPEG from NASA.  

Here's my problem.  The JPEG I'm using is 302KB.  But when I run the application (which just has one spinning sphere object mapped with that one texture), it appears to suck up 70MB of memory!  I am guessing this by watching Mozilla's memory in the Windows 2000 task manager.  It starts off at about 20-25MB.  But when I load the page with my demo, it shoots up to about 95MB.  I also doesn't appear to let go of the memory when I close the page (it finally releases the memory when I close Mozilla completely).

I am independently looking at some of the optimization pages out there, but there are a lot of topics to go through.  Could some of you guys get me started on understanding:

1. How to get a rough estimate of "reasonable" memory usage based on the number of objects, size of textures involved, etc.

2.  What "obvious" optimizations might get rid of my "dumb mistakes".

Like I said, I am also looking elsewhere, but I thought your experience could give me a head start.  I can also post the complete code if that will help.

Thanks in advance for helping a newbie,
Chris McCormick

- Check out the 3D earth program I'm working on, at . Be gentle; I'm a newbie.  :-)
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #1 - Posted 2003-03-26 13:47:45 »

This is pretty much common behaviour for j3d, it tends to land-grab large amounts of memory - even for small apps. This mainly seems to be that it was intended to scale well, so you could probably test a huge scene and get only a minimal increase in memory. Theres also a known bug where it will not release the memory properly on exit which you may be stumbling across, (anyone know if this is fixed yet?).

In short, don't worry about it yet. Keep an eye on the memory usage as you extend your app and you'll probably not see much of an increase..

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Daath

Junior Devvie

Java games rock!

« Reply #2 - Posted 2003-03-26 14:54:05 »

well I see nothing normal about that - and would not right away blame it on java3d - I am running one of my terrrain demos and using (1) texture 1.4 Meg on it and it starts with 25 Meg and stays that way until I close it other demo I   am getting about same amount of memory consumption but I am loading 256 terrain tiles(shapes3d) each having 2 textures - so it amount to at least 20times more then you are using ....
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Breakfast

Senior Devvie

for great justice!

« Reply #3 - Posted 2003-03-26 19:41:27 »

If you take a look over at you will find a set of tips to maximise performance with Java 3d. I'm not sure whether there is anything there that helps this specifically but it will probably explain it somewhere.
Pages: [1]
  ignore  |  Print  

xxMrPHDxx (309 views)
2017-12-31 17:17:51

xxMrPHDxx (97 views)
2017-12-31 17:15:51

xxMrPHDxx (148 views)
2017-12-28 18:11:33

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

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

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

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

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

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

Archive (1314 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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 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‑
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!