I tried with XX:MaxPermSize=256M but with 1 request per 2sec.
The PermGen memory is going like 15mb/min.
All the code of responing page is just like this:
{{groovy}}
@Grab(group='com.gmongo', module='gmongo', version='1.0')
import com.gmongo.GMongo
import groovy.json.*
def data = [] // a list contain data
def gmongo = new GMongo()
def dbConn = gmongo.getDB('dbtest')
// Not query database but it already go crazy
gmongoObject.close()
// For GC
dbConn = null
gmongoObject = null
// Convert into JSON
def slurper = new JsonSlurper()
def builder = new JsonBuilder(data)
println builder.toString()
// For GC
slurper = null
builder = null
{{/groovy}}
2013/9/26 Thomas Mortagne <thomas.mortagne(a)xwiki.com>
Well without changing your script all I can suggest is
to allocate
more permgen to java using
-XX:MaxPermSize=<enough memory>M
On Thu, Sep 26, 2013 at 9:25 AM, Quân Lê <lequan.moon(a)gmail.com> wrote:
Thank you
It's true that the more script responing page processes, the more classes
are loaded.
Is there anyway to prevent OutOfmemory Exception happened?
2013/9/26 Thomas Mortagne <thomas.mortagne(a)xwiki.com>
> I doubt it has anything to do with the request itself, it's probably
> more related to what your page is doing. From what I understand your
> page create directly or indirectly new classes. Note that most script
> languages compile the script into a new Java class before executing it
> so if you execute a lot of very big scripts at the same time it can
> probably be pretty costy for the permgen. Something else that could be
> costy is if you load a jar in this page for example with the "jars"
> property of script macros.
>
> On Thu, Sep 26, 2013 at 8:53 AM, lequan.moon <lequan.moon(a)gmail.com>
> wrote:
> > Hi,
> > I'm making an application that make an AJAX request frequently from
page
> to
> > page in xwiki.
> > About 1 per 10s
> > The request look like this:
> >
> > $.ajax({
> > type: "GET",
> > crossDomain: true,
> > url: "/xwiki/bin/get/Lib/LibPage?outputSyntax=plain",
> > dataType: 'text',
> > data: data2send,
> > success: function(result) {...},
> > error: function(xhr, status, error) {
> > console.log(error)
> > console.log(status)
> > console.log(xhr)
> > }
> > });
> >
> > And respone is simple as a text or something like a JSON Map, List.
> > I took a look at jconsole and here it is
> > <
>
http://xwiki.475771.n2.nabble.com/file/n7587262/9-26-2013_1-51-09_PM.jpg>
> >
> > Please help! I don't understand how xwiki works on this.
> >
> > Thank in advanced.
> >
> >
> >
> >
> > --
> > View this message in context:
>
http://xwiki.475771.n2.nabble.com/Frrequently-AJAX-request-caused-PernGen-E…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
======Lê Minh Quân======
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs