[jboss-as7-dev] cache java.lang.Proxy?

Stuart Douglas stuart.w.douglas at gmail.com
Mon Jul 9 15:55:01 EDT 2012


Not sure exactly what you mean here. The actual cache looks something like (or would look like this if the code used generics):

WeakHashMap<ClassLoader, Map<List<String>, WeakReference<Class>> loaderToCache;

As both the proxy class and the CL are held weakly, it should not stop anything being GC'ed.

Stuart

On 10/07/2012, at 12:06 AM, Bill Burke wrote:

> Hmmm. so the class itself could be garbage collected and pergen space still wasted?
> 
> On 7/7/12 6:55 PM, Stuart Douglas wrote:
>> It caches it in a weak map.
>> 
>> Stuart
>> 
>> On Sun, Jul 8, 2012 at 2:14 AM, Bill Burke <bburke at redhat.com> wrote:
>>> javadoc says that its supposed to cache it, but... who knows...
>>> 
>>> I recently had to increase the permgen space of my maven build and
>>> thought this might be it.
>>> 
>>> On 7/7/12 11:56 AM, Bill Burke wrote:
>>>> is it pretty bad to call:
>>>> 
>>>> java.lang.Proxy.newInstance(...) often?  Does it create a new class each
>>>> and every time?  Can't believe I forgot about this one...I'm a f'n idiot.
>>>> 
>>>> Bill
>>>> 
>>> 
>>> --
>>> Bill Burke
>>> JBoss, a division of Red Hat
>>> http://bill.burkecentral.com
>>> 
>>> 
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> jboss-as7-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
> 
> -- 
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
> 
> 




More information about the jboss-as7-dev mailing list