Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
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  
  generational garbage collector brainstorming  (Read 2166 times)
0 Members and 1 Guest are viewing this topic.
Offline pepe

Junior Devvie

Nothing unreal exists

« Posted 2002-11-29 19:04:45 »

I was playing with my file system classes, and was thinking on a way to potentially enhance the memory use of those classes.
They store entries, that are files - or whatever- in a fliesystem.  As those entries are cached, they might be taken out of Eden and stored as longer life object. Up to here, nothing abnormal.
Now, here is what i thought... When i refresh my cache, my first implementation was to clear the list, read the new one, and return. Simple, efficient... efficient? mhh. maybe not. What if i compared the new cached data of a directory to the old one, and only replace the ones that changed...  You might think "hey, you've already allocated the new objects.. what's the use for throwing them away, and use more cpu for nothing?".. yes, right.. why would i do that?
Well. if those new objects are in Eden, they will be collected sooner than those that are long lived, so my memory use should decrease sooner, and GC should take less time (but should occur sooner).
So.. where is the final question...what do you guys think.. is this worth the effort?
I'm not sure escape analysis would help some more to reduce garbage on that case, but that would be nice.  Do you think that  it will? why?

Mhh som many questions, and my tomcat is still not linked ajp13 with apache.. damn.. i hate them when they need to work toguether..  Cry

Home page:
GoSub: java2D gamechmark
Offline cknoll

Junior Devvie

Flame On!

« Reply #1 - Posted 2002-11-29 19:46:24 »

Could you use something like soft or phantom references to do this? you can have objects that loose references be dropped on a queue instead of being de-allocated by the JVM, and when you need a new instance of an object, you can just pop one off the queue.  Better yet, you could have the 'garbage' queue indexed in such a way that you could attempt to find an object that was already initialized with a certain state before taking any ol' one off the queue to re-init.  But, that may be more work than you are saving, but did you look into the java.lang.ref package to see if that's what you want?

Offline pepe

Junior Devvie

Nothing unreal exists

« Reply #2 - Posted 2002-11-29 20:30:17 »

Yes, i know them, but there, i think we're entering the 'reinventing the wheel' zone. Generational GC is already some kind of an object pool. if it does that for me (and certainly better than i would do)  why adding some more over it ?

Moreover, if escape analysis is to clear the allocation problem in my case, object pooling sounds like a bad idea.

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

bilznatch (27 views)
2015-08-04 11:03:17

SHC (44 views)
2015-08-01 03:58:20

Jesse (25 views)
2015-07-29 04:35:27

Riven (48 views)
2015-07-27 16:38:00

Riven (26 views)
2015-07-27 15:35:20

Riven (28 views)
2015-07-27 12:26:13

Riven (19 views)
2015-07-27 12:23:39

BurntPizza (42 views)
2015-07-25 00:14:37

BurntPizza (56 views)
2015-07-24 22:06:39

BurntPizza (35 views)
2015-07-24 06:06:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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!