Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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 2580 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


« 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. 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: 57
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.

[ - 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
Online princec

« JGO Spiffy Duke »

Medals: 581
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


« 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


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


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

BurntPizza (22 views)
2015-10-07 02:11:23

KaiHH (23 views)
2015-10-06 20:22:20

KaiHH (11 views)
2015-10-06 19:41:59

BurntPizza (24 views)
2015-10-06 19:04:48

basil_ (44 views)
2015-09-30 17:04:40

shadowstryker (22 views)
2015-09-29 15:55:06

TheSpaceHedgehog (28 views)
2015-09-29 01:58:48

GamerC4 (54 views)
2015-09-24 21:10:38

GamerC4 (71 views)
2015-09-24 21:09:48

htuy (28 views)
2015-09-24 04:57:24
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!