Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
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  
  Garbage Collector glitches  (Read 1836 times)
0 Members and 1 Guest are viewing this topic.
Offline vrm

Junior Member




where I should sign ?


« Posted 2003-02-01 17:56:44 »

I looked at my code, no repeated memory allocation, but I continue to have little ciclic garbage lag.

There is a technic for remove those little glitches Huh
Offline leknor

Junior Member




ROCK!!!


« Reply #1 - Posted 2003-02-01 18:28:48 »

Did you profile your code to try to see where Objects are being created? Maybe methods you are calling are creating garbage.

http://www.hp.com/products1/unix/java/hpjmeter/ can help and is free but there is better if you can drop some cash.

The alternative is to try calling System.gc() semi-often but there are lots of reason that isn't a reliable solution if it does seem to work for you.
Offline Orangy Tang

JGO Kernel


Medals: 48
Projects: 11


Monkey for a head


« Reply #2 - Posted 2003-02-01 19:37:43 »

"String operations" + "especially concatination" + "can create lots of garbage, all without the presence of the telltale new operator.."

GC glitches are also the reason why the LinkedList is almost totally unusable - an iterator created every time I want to loop though? No thanks.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Online princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #3 - Posted 2003-02-01 21:18:17 »

I still couldn't get rid of some teeny GC glitches in XAP despite getting my new()ing down to just allocating new gidrahs when they spawned. Solved it with -Xincgc -Xconcgc.

You have to create some garbage here and there.

I advise a System.gc() when a level ends too Cheesy

Cas Smiley

Offline vrm

Junior Member




where I should sign ?


« Reply #4 - Posted 2003-02-02 07:32:09 »

it's ammazing, those options removed it ..

thx  Grin
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #5 - Posted 2003-02-02 12:15:26 »

Without being able to track that down, we found the GC is not the main reason for 'glitches'. In our gaming app, when prototyping things, 1000ths of objects may be allocated per second. After removing the 'news' and replacing them with object-reuse (most they are Matrix4f/Vector3f), there was no significant improvement.
I used to log the GC by -verboce:gc and found there was no coinicidence of GC events and the perceivable glitches - even if we run with 100fps and above.

GC maybe one source, but on todays very fast machines, it is also a very fast thing and seldom the reason, although often suspected.


HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline darcone

Junior Member




Size matters


« Reply #6 - Posted 2003-04-01 10:28:59 »

So basically what should I avoid to do after System.gc() ? Create all objects of course, and then? Shouldn´t I do string operations in performance critical situations?
Offline erikd

JGO Knight


Medals: 3
Projects: 3


Maximumisness


« Reply #7 - Posted 2003-04-01 11:17:20 »

More specifically, you should use String operations as little as possible and create as little as possible (short lived) objects (especially heavy ones) in general in your game loops and inner loops.
Certainly, avoiding the new keyword doesn't necessarily mean that you're not creating garbage.
Just do one XSL transformation using Xalan in your game loop and you'll know what I mean  Grin (no GC can cope with *that*)

Offline darcone

Junior Member




Size matters


« Reply #8 - Posted 2003-04-01 13:11:11 »

So you mean that I should remove the method that reads my 20 XML files every frame? =P
Offline erikd

JGO Knight


Medals: 3
Projects: 3


Maximumisness


« Reply #9 - Posted 2003-04-01 13:38:25 »

Grin

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (105 views)
2013-05-17 21:29:12

alaslipknot (114 views)
2013-05-16 21:24:48

gouessej (142 views)
2013-05-16 00:53:38

gouessej (138 views)
2013-05-16 00:17:58

theagentd (150 views)
2013-05-15 15:01:13

theagentd (135 views)
2013-05-15 15:00:54

StreetDoggy (178 views)
2013-05-14 15:56:26

kutucuk (201 views)
2013-05-12 17:10:36

kutucuk (202 views)
2013-05-12 15:36:09

UnluckyDevil (208 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.115 seconds with 21 queries.