Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (523)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (591)
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 2210 times)
0 Members and 1 Guest are viewing this topic.
Offline vrm

Junior Devvie




where I should sign ?


« Posted 2003-02-01 16: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 Devvie




ROCK!!!


« Reply #1 - Posted 2003-02-01 17: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: 56
Projects: 11


Monkey for a head


« Reply #2 - Posted 2003-02-01 18: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!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 422
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2003-02-01 20: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 Devvie




where I should sign ?


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

it's ammazing, those options removed it ..

thx  Grin
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #5 - Posted 2003-02-02 11: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 Devvie




Size matters


« Reply #6 - Posted 2003-04-01 08: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 Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #7 - Posted 2003-04-01 09: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 Devvie




Size matters


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

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

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


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

Grin

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.

trollwarrior1 (34 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (66 views)
2014-11-07 19:57:14

TehJavaDev (70 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (83 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
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!