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

Junior Devvie




Nothing unreal exists


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

Hello.
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: http://frederic.barachant.com
------------------------------------------------------
GoSub: java2D gamechmark http://frederic.barachant.com/GoSub/GoSub.jnlp
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?

-Chris
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: http://frederic.barachant.com
------------------------------------------------------
GoSub: java2D gamechmark http://frederic.barachant.com/GoSub/GoSub.jnlp
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.

rwatson462 (36 views)
2014-12-15 09:26:44

Mr.CodeIt (29 views)
2014-12-14 19:50:38

BurntPizza (61 views)
2014-12-09 22:41:13

BurntPizza (98 views)
2014-12-08 04:46:31

JscottyBieshaar (58 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (76 views)
2014-11-29 21:32:03

toopeicgaming1999 (137 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (37 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!