Excellent question. While I have not performed any formal study on
Perm Gen space usage, I put in two safeguards to help limit it. As
you asked, I have indeed put a cache in place for proxy classes, so
that as additional proxies are requested they first look in the
cache. Secondly, I have given the user the option to reuse instances
of the proxies multiple times, to wrap multiple methods using the same
proxy instance. This second mechanism really provides no advantage
over the first since the cache is always in place. But it does
provide brevity of expression, and if caching were to be eliminated or
optional in the future there would still be this means of limiting
Perm Gen exhaustion.
Thanks for the question.
-- Kervin
On Nov 2, 6:38 am, Alexey Frishman <
alexey.frish...@gmail.com> wrote:
> Hi dear authors!
>
> I find your library amazing and I want to use it in my projects.
>
> My only concern is about Perm Gen space limit. I know that usually every
> new proxy class is created in Perm Gen space. Also I know that very
> extensive usage of proxies causes hitting the limit of Perm Gen space and
> OutOfMemoryError as result. Have you tried to test, how much memory is
> consumed, while using the library? Is new class in Perm Gen created every
> time I call corresponding method from the library, or those classes are
> created only first time for some functional signature and all the next
> times they are only taken from cache?