Re: [xSocket-develop] Question about optimization
Status: Inactive
Brought to you by:
grro
|
From: Brad M. <br...@br...> - 2010-06-08 22:08:08
|
So do you actually get OutOfMemoryException's? Increasing heap memory
usage isnt necessarily a memory leak. Any process which uses and
releases objects will see increasing heap memory usage, up until the
point where gc reclaims it. But gc won't bother reclaiming it until you
approach your memory limit. Eg if your min and max heap sizes are both
set to 512Mb you might not see any memory being reclaimed until you're
up to almost 500Mb
Which is why i'm interested to know what your min and max heap sizes are
(assuming you're even using the Sun VM, IBM's is totally different) and
whether you eventually see memory errors.
Given the usage you described, I would expect that the performance
bottleneck would be the database. 500 transactions per second is high
for most commodity databases.
Cheers,
Brad
Michal Bucko wrote:
> Hi Brad,
> I am running client and server (in Java and xsocket). Client is sending 500
> times/second to the server, and the server forwards message to as the
> database query. I think that the server cannot handle that much information
> (too much information!). When, for instance, the clientis turned off, the
> server still receives information for some time. Can we influence the buffer
> size? What is all about DirectBuffer (that helped before, but still the
> memory increases).
> Info: J2SE 6, org.xsocket.connection.dispatcher.maxHandles =
> 3org.xsocket.connection.client.readbuffer.preallocated.minSize =
> 10org.xsocket.connection.server.readbuffer.preallocated.minSize =
> 10org.xsocket.connection.client.readbuffer.preallocation.size =
> 64org.xsocket.connection.server.readbuffer.preallocation.size =
> 64org.xsocket.connection.client.readbuffer.defaultMaxReadBufferThreshold =
> 3org.xsocket.connection.server.readbuffer.defaultMaxReadBufferThreshold =
> 3org.xsocket.connection.server.readbuffer.usedirect =
> trueorg.xsocket.connection.server.readbuffer.preallocation.size =
> 64org.xsocket.connection.server.workerpoolSize =
> 5org.xsocket.connection.server.workerpoolMinSize =
> 1org.xsocket.connection.server.readbuffer.defaultMaxReadBufferThreshold = 3
> (i don't fully understand these parametres)
> Thank You for help,
> Michal
>
> Dnia 2010-06-07 20:31 Brad McEvoy napisał(a):
>
>> Hi Michal,
>>
>> I'm interested in finding out more abou this problem. Do you actually
>> get out of memory exception errors if this is left to run? What JVM are
>> you using and on what OS? Assuming you're using the sun VM, what is your
>> maximum and initial memory settings?
>>
>> Cheers,
>> Brad
>>
>> On Sun, 06 Jun 2010 15:42 +0200, "Michal Bucko"
>> <mic...@el...> wrote:
>>
>>> Hi Gregor,
>>>
>>> I will now use visual gc and provide more information ASAP. The problem
>>> appears even in the simple code where the only thing
>>> I do is sending a query to MySQL database. I have tried to trigger GC by
>>> using System.GC but it didnt work (the chart was smoother,
>>> but still it was going up). As I probably said before, using
>>> S_start -
>>> System.setProperty("org.xsocket.connection.server.readbuffer.usedirect",
>>> "true");C_start -
>>> System.setProperty("org.xsocket.connection.client.readbuffer.usedirect",
>>> "true");
>>> helped me to get 50MB memory consumption (very high) in 60 minutes
>>> instead
>>> of 250MB in 20minutes without it.
>>> Tried with flushing, but that didn't help at all.
>>> I will provide more info ASAP but could You, please, give me some hints
>>> as
>>> how to deal with GC/xsocket issues in general? Maybe
>>> this will help - in the same time Im working on visual gc info.
>>> Best regards,
>>> Michal
>>>
>>> Dnia 2010-06-05 17:31 Gregor Roth napisał(a):
>>>
>>>> />
>>>> Hi Michal,
>>>>
>>>> have you already check the garbage collection behaviour. xSocket should
>>>>
> be
>
>>> free of memory leaks. It will be permanently check for memory leaks. For
>>> this reason the garbage collector should free memory after a period or
>>> time
>>> (by exceeding a threshold). Did you check the memory behaviour of your
>>> app
>>> with tools such as visual gc?
>>>
>>>> Gregor
>>>>
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: Michal Bucko
>>>> Sent: 06/05/10 01:39 PM
>>>> To: xso...@li...
>>>> Subject: Re: [xSocket-develop] Question about optimization
>>>>
>>>> Hi Gregor, So the question is: how can I write an application in Java
>>>>
> using
>
>>> xsocket library so that the application works as server application, ie.
>>> the
>>> server doesnt increase in memory consumption. Memory and profiling
>>> screenshots: http://wgrajfoto.pl/pokaz/img0610/aaadc52.jpg
>>> http://wgrajfoto.pl/pokaz/img0610/pamiec3d05.jpg Thank You for help,
>>> Michal
>>>
>>>
> ----------------------------------------------------------------------------
>
>>> -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad
>>> Father's
>>> Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize
>>> list and enter to win: http://p.sf.net/sfu/thinkgeek-promo
>>> _______________________________________________ xSocket-develop mailing
>>> list
>>> xSo...@li...
>>> https://lists.sourceforge.net/lists/listinfo/xsocket-develop
>>>
>>>>
>>>
> ----------------------------------------------------------------------------
> --
>
>>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> lucky parental unit. See the prize list and enter to win:
>>> http://p.sf.net/sfu/thinkgeek-promo
>>> _______________________________________________
>>> xSocket-develop mailing list
>>> xSo...@li...
>>> https://lists.sourceforge.net/lists/listinfo/xsocket-develop
>>>
>>>
>> --
>> Brad McEvoy
>> br...@br...
>>
>>
> >
|