You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Felipe Schnack <fe...@ritterdosreis.br> on 2002/12/06 19:48:29 UTC

OFF-TOPIC: weak references

  This is actually about java in general
  I just to assure I understood the concept of WeakHashMap. What is weak
referenced in this map is the keys, right? So, let's say I have a
WeakHashMap and a HashMap, both with the same key/value pairs. When I
remove an object from the HashMap the garbage collector will remove its
REFERENCE in the WeakHashMap object, but not necessarily the object,
correct?

-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: OFF-TOPIC: weak references

Posted by micael <ca...@harbornet.com>.
The object is not gced.  That is right.

At 05:00 PM 12/6/2002 -0200, you wrote:
>   Yes, so the reference to my object is gc'd, not the object itself (as
>long its key is not strongly referenced anywhere else) when I remove an
>object from the HashMap
>   right?
>
>On Fri, 2002-12-06 at 16:59, micael wrote:
> > If you still have a reference to the object in the HashMap the object 
> won't
> > be gced.  The weak hash map is just a weak hash map, not a "weak
> > application" in the appropriate sense.
> >
> > At 04:48 PM 12/6/2002 -0200, you wrote:
> > >   This is actually about java in general
> > >   I just to assure I understood the concept of WeakHashMap. What is weak
> > >referenced in this map is the keys, right? So, let's say I have a
> > >WeakHashMap and a HashMap, both with the same key/value pairs. When I
> > >remove an object from the HashMap the garbage collector will remove its
> > >REFERENCE in the WeakHashMap object, but not necessarily the object,
> > >correct?
> > >
> > >--
> > >
> > >Felipe Schnack
> > >Analista de Sistemas
> > >felipes@ritterdosreis.br
> > >Cel.: (51)91287530
> > >Linux Counter #281893
> > >
> > >Faculdade Ritter dos Reis
> > >www.ritterdosreis.br
> > >felipes@ritterdosreis.br
> > >Fone/Fax.: (51)32303328
> > >
> > >
> > >--
> > >To unsubscribe, 
> e-mail:   <ma...@jakarta.apache.org>
> > >For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> >
> > Micael
> >
> > -------------------------------------------------------
> >
> > This electronic mail  transmission and any accompanying documents contain
> > information belonging to the sender which may be confidential and legally
> > privileged.  This information is intended only for the use of the
> > individual or entity to whom this electronic mail transmission was sent as
> > indicated above. If you are not the intended recipient, any disclosure,
> > copying, distribution, or action taken in reliance on the contents of the
> > information contained in this transmission is strictly prohibited.  If you
> > have received this transmission in error, please delete the 
> message.  Thank
> > you
> >
> >
> >
> > --
> > To unsubscribe, 
> e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> >
>--
>
>Felipe Schnack
>Analista de Sistemas
>felipes@ritterdosreis.br
>Cel.: (51)91287530
>Linux Counter #281893
>
>Faculdade Ritter dos Reis
>www.ritterdosreis.br
>felipes@ritterdosreis.br
>Fone/Fax.: (51)32303328
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

Micael

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

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: OFF-TOPIC: weak references

Posted by Felipe Schnack <fe...@ritterdosreis.br>.
  Yes, so the reference to my object is gc'd, not the object itself (as
long its key is not strongly referenced anywhere else) when I remove an
object from the HashMap
  right?

On Fri, 2002-12-06 at 16:59, micael wrote:
> If you still have a reference to the object in the HashMap the object won't 
> be gced.  The weak hash map is just a weak hash map, not a "weak 
> application" in the appropriate sense.
> 
> At 04:48 PM 12/6/2002 -0200, you wrote:
> >   This is actually about java in general
> >   I just to assure I understood the concept of WeakHashMap. What is weak
> >referenced in this map is the keys, right? So, let's say I have a
> >WeakHashMap and a HashMap, both with the same key/value pairs. When I
> >remove an object from the HashMap the garbage collector will remove its
> >REFERENCE in the WeakHashMap object, but not necessarily the object,
> >correct?
> >
> >--
> >
> >Felipe Schnack
> >Analista de Sistemas
> >felipes@ritterdosreis.br
> >Cel.: (51)91287530
> >Linux Counter #281893
> >
> >Faculdade Ritter dos Reis
> >www.ritterdosreis.br
> >felipes@ritterdosreis.br
> >Fone/Fax.: (51)32303328
> >
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> Micael
> 
> -------------------------------------------------------
> 
> This electronic mail  transmission and any accompanying documents contain 
> information belonging to the sender which may be confidential and legally 
> privileged.  This information is intended only for the use of the 
> individual or entity to whom this electronic mail transmission was sent as 
> indicated above. If you are not the intended recipient, any disclosure, 
> copying, distribution, or action taken in reliance on the contents of the 
> information contained in this transmission is strictly prohibited.  If you 
> have received this transmission in error, please delete the message.  Thank 
> you  
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: OFF-TOPIC: weak references

Posted by micael <ca...@harbornet.com>.
If you still have a reference to the object in the HashMap the object won't 
be gced.  The weak hash map is just a weak hash map, not a "weak 
application" in the appropriate sense.

At 04:48 PM 12/6/2002 -0200, you wrote:
>   This is actually about java in general
>   I just to assure I understood the concept of WeakHashMap. What is weak
>referenced in this map is the keys, right? So, let's say I have a
>WeakHashMap and a HashMap, both with the same key/value pairs. When I
>remove an object from the HashMap the garbage collector will remove its
>REFERENCE in the WeakHashMap object, but not necessarily the object,
>correct?
>
>--
>
>Felipe Schnack
>Analista de Sistemas
>felipes@ritterdosreis.br
>Cel.: (51)91287530
>Linux Counter #281893
>
>Faculdade Ritter dos Reis
>www.ritterdosreis.br
>felipes@ritterdosreis.br
>Fone/Fax.: (51)32303328
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

Micael

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

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>