Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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  
  Windows process memory going crazy with Xith and JOGL  (Read 3935 times)
0 Members and 1 Guest are viewing this topic.
Offline Zer Gut Shnitzel

Senior Newbie





« Posted 2006-03-03 07:13:18 »

Hi there, I know this might sound like more appropriate for JOGL or Xith forum but still it might be a completely different issue.

My Xith based app uses tons of geometry and textures, we are trying to be smart by implementing Texture and geometry managers as the nature of application requires reusing same geometry all over the place (just under different transforms). Xith has a shared copy feature which is supposed to do instancing. After some experimentation it appeared like Xith's sharedNode feature works fine. We did some tests and using shared nodes proved to be a huge gain when heap size is profiled. On the other side the process size is going crazy with memory usage and barely ever goes down even when complete cleanup is done (all objects destroyed and GCed) the process mem usage doesn't go down.

My assumption is that the leak like this can only appear somewhere in Xith or JOGL using NIO Buffers. Does anyone know if NIO Buffers can cause this behavior if not managed properly ?

In some examples that we did, our heap usage will be around 750 Mb while Java allocates around 950Mb, the process size goes up to 1.7Gb. After cleaning up all the 3d data and garbage collecting explicitly, Java heap usage is at 125Mb it still has its 950Mb allocated (expected). If we start adding object to the heap again, the process size will go up and eventually crash when process size reaches 2Gb and windows bails out of virtual memory.

Does anyone know if Java 3d handles instancing better and if it has any similar memory leaks. I am willing to switch to other APIs preferably Java3D rather than fixing Xith on a low level.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #1 - Posted 2006-03-03 12:32:50 »

Once the VM has grabbed memory from the OS, it does not return it until it is shutdown.  It probably assumes that if memory usage can get up to a certain level once, it can again.

Offline Zer Gut Shnitzel

Senior Newbie





« Reply #2 - Posted 2006-03-03 16:31:15 »

That's right, but the process size (on a 950 Mb of allocated heap) becomes 1.7 Gb (almost twice the size) and it keeps growing up even when you clean up the heap and have 800 Mb free. So what happens is JVM has around 800Mb of free allocated heap and its happy, but process will eventually crash as it hits 2Gb and depletes all the available memory on the system. 
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #3 - Posted 2006-03-03 21:54:18 »

Once the VM has grabbed memory from the OS, it does not return it until it is shutdown.  It probably assumes that if memory usage can get up to a certain level once, it can again.

Are you sure?

I thought there was a limit to the amount of free memory to keep ready beyond the minimum heap size and that the JVM would release memory if certain thresholds were exceeded.

Offline Jeff

JGO Coder




Got any cats?


« Reply #4 - Posted 2006-03-04 01:34:25 »

Once the VM has grabbed memory from the OS, it does not return it until it is shutdown.  It probably assumes that if memory usage can get up to a certain level once, it can again.

Are you sure?

I thought there was a limit to the amount of free memory to keep ready beyond the minimum heap size and that the JVM would release memory if certain thresholds were exceeded.

Your both right,

The Sun VM will release memory back to the system.  However to avoid thrashing it wont do it right away, it waits a bit to see if the memory requiremenst have **really** gone down.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2006-03-04 19:50:50 »

...and it's tuneable, too.

Cas Smiley

Offline Zer Gut Shnitzel

Senior Newbie





« Reply #6 - Posted 2006-03-04 20:58:32 »

.. oh I see, its tunable 
Offline cylab

JGO Ninja


Medals: 38



« Reply #7 - Posted 2006-03-13 12:51:03 »

On a completly different matter: Where does your nick come from? See, I am german and I nearly spit my coffee all over my desk, the first time I realized it. No offence intended, if this is your real name, of course Wink

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

JGO Coder




Got any cats?


« Reply #8 - Posted 2006-03-14 02:51:11 »

Doesnt that mean "The Good Sausage?"

Edit:  Wait, Der is "The" Zer is...  very?  "Very Good Sausage?"

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #9 - Posted 2006-03-15 04:46:16 »

Is that some sort of sexual joke? Grin

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cylab

JGO Ninja


Medals: 38



« Reply #10 - Posted 2006-03-15 10:27:40 »

Actually it's "Very Good Escalope", but totally misspelled, so you only recognize it if you say it out loud Smiley

Mathias - I Know What [you] Did Last Summer!
Offline Zer Gut Shnitzel

Senior Newbie





« Reply #11 - Posted 2006-03-19 23:58:35 »

It's just that earlier that day I had one Zer Gut Escalope for lunch...  Smiley)

Back to the topic.. ...how would one go about tuning the JVM's release of allocated heap back to the system (Windows)? We have found out that the problem we are experiencing is related to some geometry that we are creating on the fly as we need to dinamically update lots of geometry, what would be the best approach for allowing lots of geometry updates, using VBO's, Display lists, etc. ?

Offline c_lilian

Senior Member


Projects: 1


Java games will probably rock someday...


« Reply #12 - Posted 2006-03-23 09:31:21 »

I have another related problem I'm currently investigating :

The game starts with min heap size of 80M and max 150M, but never really reached 80 (70 max, 40 normal use).

On the other hand, looking at the java.exe process memory usage, every level played adds its 5M to the total memory used (well +7, then -2 at the end)
So from the java side, GC is fine, and VM profiling shows no memory leak, but from the NIO buffers size... it keeps increasing (up to 300M in my test, but kept growing).

So what's the ergonomics of GC from the native buffers side ? (I must say I currently call System.gc() after every level loading)
If it's a memory leak from the Xith side, what strategy could anybody give me to find the bug ?
(I'm already browsing the entire xith rendering codebase to find the possible leaks)

Is it a good practice to have many small nio buffers used when calling OGL functions (can they cause memory fragmentation preventing gc ?)

Any help will be most appreciated !

Lilian Smiley

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 742
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #13 - Posted 2006-03-23 11:03:50 »

direct NIO buffers have tiny java-heap objects, which are unlikely (low prio) to get GCed when they survived eden-space.

A full GC should take care of them though.

Unless there are references kept to these java-objects in Xith, I'd assume it is the "general problem" of NIO-buffers.


Better to do pooling (and for small buffers slice() a larger buffer into tiny pieces)


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.

pw (12 views)
2014-07-24 01:59:36

Riven (10 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (42 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!