Are objects used together by reachability or not? how much?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Are objects used together by reachability or not? how much?

Mariano Martinez Peck
Hi. I am looking for a paper, investigation, or maybe just thoughts about the following: objects delegate to other objects to achieve something. Objects have collaborators, which are other objects. Several times, those collaborators are represented by instance variables.

I am trying to group objects that haven't been used for a while and swap them to disk (and let proxies in the image). I have several of grouping objects. For example I can just group them (without a particular strategy) in pages. Now, my guess is that when an objects is used, usually (this "usually" is the key of my problem) its instance variables are used too. And when an object is not used, its instance variable are not used neither.

So....do you have a paper talking about how much this "usually" is? which percentage? some estimations ?
If not, do you have an idea how we can compute this?  my ideas are quite naive....just parsing methods and check whether they access its instVar or not.  And of course, this depends on runtime, because there can be conditions on it.
And maybe only one single method of an object access an instVar (like an getter), but then that message is sent millions of time...

I guess I need to run runtime statistics..

Do you think we can gain something grouping objects this way instead of ranomdly in pages?

Anyway, any hint is appreciated.

Cheers

Mariano
Reply | Threaded
Open this post in threaded view
|

Re: Are objects used together by reachability or not? how much?

Alexandre Bergel-5
> I am trying to group objects that haven't been used for a while and swap them to disk (and let proxies in the image). I have several of grouping objects. For example I can just group them (without a particular strategy) in pages. Now, my guess is that when an objects is used, usually (this "usually" is the key of my problem) its instance variables are used too. And when an object is not used, its instance variable are not used neither.
>
> So....do you have a paper talking about how much this "usually" is? which percentage? some estimations ?
> If not, do you have an idea how we can compute this?  my ideas are quite naive....just parsing methods and check whether they access its instVar or not.  And of course, this depends on runtime, because there can be conditions on it.
> And maybe only one single method of an object access an instVar (like an getter), but then that message is sent millions of time...


So, you need to know on average what is the use of instance variable?
Will putting a counter in accessor and mutator methods do the work?

Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Are objects used together by reachability or not? how much?

Jecel Assumpcao Jr
In reply to this post by Mariano Martinez Peck
Mariano,

while I haven't seen any papers with the statistics you need, you
might find the information in the LOOM and Mushroom papers
interesting.

http://www.wolczko.com/mushroom/index.html

The "dynamic grouping" papers are specially relevant. Note that they
were trying to integrate virtual memory and garbage collection so that
they don't fight each other. The problem is easy to see - think of a
non compacting mark-and-sweep GC running on top of a regular paging
virtual memory. You will probably touch every page on each gc cycle,
causing a vast amount of disk traffic. You mentioned randomly
distributing the objects among pages, now imagine that you have a
copying garbage collector: after a while, objects will have been moved
around so that an object and the objects it points to will tend to
live on the same page so the virtual memory will swap them out or in
together.

http://portal.acm.org/citation.cfm?id=94112

http://portal.acm.org/citation.cfm?id=28697.28707&type=series

and chapter 14 (pages 251 to 270) of the "green book" all talk about
LOOM.

http://stephane.ducasse.free.fr/FreeBooks/BitsOfHistory/

An interesting feature in LOOM was the option to bring an object only
partially into memory. That is, most of its instance variables would
have a special "lambda" value until you actually tried to use it in
any way. So that the code that expanded these lambdas would be very
convenient places to insert statistics gathering code to find out
stuff like what percentage of an object's instance variables get
touched before the object ends up being sent back to disk.

-- Jecel
Reply | Threaded
Open this post in threaded view
|

Re: Are objects used together by reachability or not? how much?

Diego-4
In reply to this post by Mariano Martinez Peck
Hi!
GemStone has the same problem, when it saves the objects to disk. In the programming guide it has a chapter called "Tuning Performance" with a section 12.1 Clustering Objects for Faster Retrieval which is about grouping objects that are often accessed together to improve performance by reducing disk access. You may want to ask the people of GemStone, or someone who uses that feature, which criteria they use to decide how to group the objects...

My thoughts about "when an objects is used, usually its instance variables are used too": I think it depends on who is designing the objects. Some people design objects, so they only have a single responsibility, while other people put several related responsibilities in each object. When an object has a single responsibility, you generally use the object, to use that responsibility, and it generally uses every instance variable it has... When it has several responsibilities, it can use all instance variables, or only a subset of them, depending on how cohesive the object, and it's responsibilities are... So I don't think there is a "general" answer... It depends on the programmer/Design...


Diego

On Tue, Jan 11, 2011 at 8:33 AM, Mariano Martinez Peck <[hidden email]> wrote:
Hi. I am looking for a paper, investigation, or maybe just thoughts about the following: objects delegate to other objects to achieve something. Objects have collaborators, which are other objects. Several times, those collaborators are represented by instance variables.

I am trying to group objects that haven't been used for a while and swap them to disk (and let proxies in the image). I have several of grouping objects. For example I can just group them (without a particular strategy) in pages. Now, my guess is that when an objects is used, usually (this "usually" is the key of my problem) its instance variables are used too. And when an object is not used, its instance variable are not used neither.

So....do you have a paper talking about how much this "usually" is? which percentage? some estimations ?
If not, do you have an idea how we can compute this?  my ideas are quite naive....just parsing methods and check whether they access its instVar or not.  And of course, this depends on runtime, because there can be conditions on it.
And maybe only one single method of an object access an instVar (like an getter), but then that message is sent millions of time...

I guess I need to run runtime statistics..

Do you think we can gain something grouping objects this way instead of ranomdly in pages?

Anyway, any hint is appreciated.

Cheers

Mariano



--
Diego Geffner
-------------------------------------------------
Desarrollo y Tecnología - Mercap S.R.L.
Tacuarí 202 - 7º Piso - Tel: 54-11-48781116 al 19
Interno: 121
Ciudad Autónoma de Buenos Aires - Argentina
http://www.mercapsoftware.com

-------------------------------------------------

Este mensaje es confidencial. Puede contener información amparada por el secreto profesional. Si usted ha
recibido este e-mail por error, por favor comuníquenoslo inmediatamente via e-mail y tenga la amabilidad
de eliminarlo de su sistema; no deberá copiar el mensaje ni divulgar su contenido a ninguna persona.
Muchas gracias.

This message is confidential. It may also contain information that is privileged or otherwise legally exempt
from disclosure. If you have received it by mistake please let us know by e-mail immediately and delete it
from your system; also you shouldn't copy the message nor disclose its contents to anyone. Thanks.