Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Feb 2013 09:53:49 +0100
From:      "Ronald Klop" <ronald-freebsd8@klop.yi.org>
To:        "Jurij Kovacic, OCPEA d.o.o." <jurij.kovacic@ocpea.com>
Cc:        freebsd-java@freebsd.org
Subject:   Re: Java threads on multiple processor cores
Message-ID:  <op.ws7kbzpb8527sy@ronaldradial.versatec.local>
In-Reply-To: <512E3148.3000906@ocpea.com>
References:  <51283B84.5050709@ocpea.com> <op.ws05mir88527sy@pinky> <512E3148.3000906@ocpea.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 27 Feb 2013 17:16:08 +0100, Jurij Kovacic, OCPEA d.o.o.  
<jurij.kovacic@ocpea.com> wrote:

> Hello!
>
> On 02/24/2013 10:50 PM, Ronald Klop wrote:
>> On Sat, 23 Feb 2013 04:46:12 +0100, Jurij Kovacic, OCPEA d.o.o.  
>> <jurij.kovacic@ocpea.com> wrote:
>>
>>> Hi,
>>>
>>> I am running JBoss application server inside a jail on FreeBSD 8.3.  
>>> Since the server has a quad-core processor, it would be efficient if  
>>> the java process (and its threads) could utilize more than 1 CPU core  
>>> at a time, which is not currently the case.
>>>
>>> Is it possible to acomplish this (perhaps with the use of a proper  
>>> threading library) or am I barking up the wrong tree?
>>>
>>> Thank you for your reply,
>>> Jurij
>>
>> I don't think there is a clear answer on this. It all depends on what  
>> is running in your JBoss application server. If that application does  
>> not use more than one thread, there is nothing going to use the other  
>> cores. If your application uses multiple threads and you are sure they  
>> should all be calculating very hard than you should debug the  
>> application for bottlenecks. And look if the bottleneck is in the  
>> application code, in the JDK or in FreeBSD. This is not possible  
>> without inside information of what your application is doing.
> First of all, thank you very much for your reply.
>
> As it has turned out, I was not too precise in my earlier question -  
> after some testing I have found  that after some intense page reloading,  
> full GC gets triggered. The thread running uses 100% of one core,while  
> all the other threads (presumably), have to wait for it to finish. Is  
> there any way to make full GC run in multiple threads?
>
> Kind regards,
> Jurij


I see in your other mail that you are familiar with choosing a GC on the  
command line. My experience is to just let the jvm choose the best  
settings unless you run a very special application and have a lot of  
knowledge about the internals of the GC. The guys (and girls) working on  
Java have done some pretty good work on this GCing.

What sounds more troublesome (and yes I'm a bit guessing here, because I  
don't know your application) is that your application keeps doing GC for a  
long time. That sounds like your JVM runs with not enough memory or you  
have a memory leak somewhere.

While your application is running you can see statistics of GC with this  
command.
jstat -gc -t -h10 <pid> 5s

FGC increases with every new full gc run. Does OU (Old Usage) decrease  
after a FGC? If not the GC could not free any memory and it will keep  
GC'ing very hard.

Ronald.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.ws7kbzpb8527sy>