There is also some old APIs like $xwiki.parseGroovyFromPage and also
the way to insert groovy in xwiki/1.0 syntax but I doubt it's going to
help you much here anyway.

AFAIK yes the way groovy work is by creating a new class each time its
asked to execute a script. Now in the case of groovy macro (or any
other script macro) a dedicated classloader is created to hold the
classes generated by the scripts but this classloader is only kept for
a single request so it should be automatically wiped by the garbage
collector I guess.

When executing very often a script, something that should avoid the
issue you have and improve performance (not building the script
everytime) is to inject your groovy as a script service (see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Create+a+component+using+Groovy)
once and then call it with one line of Velocity for example. If it's
very simple another way to workaround it is to use Velocity instead of
Groovy since Velocity is not compiled.

In the meantime it would be great if you could create an issue on
http://jira.xwiki.org with details on how to reproduce it so that I
look at it in detail with a profiler or something when I have some
time and find some way to improve that.


On Wed, Jun 4, 2014 at 7:24 AM, lequan.moon <lequan.m...@gmail.com> wrote:
> Yes, i use the tag {{groovy}} for groovy script.
> Is there anyway else??
>
>
>
> --
> View this message in context: 
> http://xwiki.475771.n2.nabble.com/groovy-and-PermGen-space-exception-tp7590836p7590849.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users



-- 
Thomas Mortagne
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to