Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

WeakHash Classloader

Thread view: 
horndude77@gmail.com - 09 May 2006 21:04 GMT
Hello,

I'm wanting to make a classloader which when all classes contained in
certain jars no longer have any live objects their classloader is
garbage collected. My initial idea was to use a WeakHash so the
classloader would automatically be garbage collected when memory is
needed, but I couldn't quite get that to work (I don't have the code
right now, but maybe I'll post that later). The reason we would like
this is because the memory for our project is constrained and we need
to have a fairly long uptime. After running a while having all these
extra classes around which are not always needed becomes a big
limitation.

So I'm wondering if this is possible or if you could point me in the
right direction. Thanks for the help!

-----Horndude77
Chris Uppal - 10 May 2006 11:51 GMT
> I'm wanting to make a classloader which when all classes contained in
> certain jars no longer have any live objects their classloader is
> garbage collected. My initial idea was to use a WeakHash so the
> classloader would automatically be garbage collected when memory is
> needed, but I couldn't quite get that to work (I don't have the code
> right now, but maybe I'll post that later).

I don't think there's anything wrong with the general idea (although I don't
really see what you would use your WeakHashMap for).  It can be tricky to get
the details right, though.

   -- chris
EJP - 11 May 2006 02:32 GMT
> I'm wanting to make a classloader which when all classes contained in
> certain jars no longer have any live objects their classloader is
> garbage collected.

Isn't that how classloaders work anyway? if there is no other reference
to the classloader that is, outside the classes it has loaded.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.