Need details about "Lock Profiling" tab of JRockit JRA

Hi,
I'm experimenting with the JRockit JRA tool: I think this is a very useful tool ! It provides very valuable information.
About locks ("Lock Profiling" tab), since JRockit manages locks in a very sophisticated manneer, it enables to get very important information about which monitors are used by the application, helping for improving the performances.
Nevertheless, the BEA categories (thin/fat, uncontended/contended, recursive, after sleep) are not so clear. A short paper explaining what they mean would greatly help.
Fat contended monitors cost the most, but maybe 10000 thin uncontended locks cost the same as 1 fat contended lock does. We don't know.
So, there is a lack of information about the cost (absolute: in ms, or relative: 1 fat lock costs as N thin locks) of each kind of monitor. This information would dramaticaly help people searching where improvements of lock management are required in their application.
Thanks,
Tony

great explanation! Thanks
"ihse" <[email protected]> wrote in message
news:18555807.1105611467160.JavaMail.root@jserv5...
About thin, fat, recursive and contended locks in JRockit:
Let's start with the easiest part: recursive locks. A recursive lock
occurs in the following scenario:synchronized(foo) {  // first time thread takes lock
synchronized(foo) {  // this time, the lock is taken recursively
}The recursive lock taking may also occur in a method call several levels
down - it doesn't matter. Recursive locks are not neccessarily any sign of
bad programming, at least not if the recursive lock taking is done by a
separate method.
The good news is that recursive lock taking in JRockit is extremely fast.
In fact, the cost to take a lock recursively is almost negligable. This is
regardless if the lock was originally taken as a thin or a fat lock
(explained in detail below).
Now let's talk a bit about contention. Contention occurs whenever a thread
tries to take a lock, and that lock is not available (that is, it is held
by another thread). Let me be clear: contention ALWAYS costs in terms of
performance. The exact cost depends on many factors. I'll get to some more
details on the costs later on.
So if performance is an issue, you should strive to avoid contention.
Unfortunately, in many cases it is not possible to avoid contention -- if
you're application requires several threads to access a single, shared
resource at the same time, contention is unavoidable. Some designs are
better than others, though. Be careful that you don't overuse
synchronized-blocks. Minimize the code that has to be run while holding a
highly-contended lock. Don't use a single lock to protect unrelated
resources, if that lock proves to be easily contended.
In principle, that is all you can do as an application developer: design
your program to avoid contention, if possible. There are some experimental
flags to change some of the JRockit locking behaviour, but I strongly
discourage anyone from using these. The default values is carefully
trimmed, and changing this is likely to result in worse, rather than
better, performance.
Still, I understand if you're curious to what JRockit is doing with your
application. I'll give some more details about the locking strategies in
JRockit.
All objects in Java are potential locks (monitors). This potential is
realized as an actual lock as soon as any thread enters a synchronized
block on that object. When a lock is "born" in this way, it is a kind of
lock that is known as a "thin lock". A thin lock has the following
characteristics:
* It requires no extra memory -- all information about the lock is stored
in the object itself.
* It is fast to take.
* Other threads that try to take the lock cannot register themselves as
contending.
The most costly part of taking a thin lock is a CAS (compare-and-swap)
operation. It's an atomic instruction, which means as far as CPU
instructions goes, it is dead slow. Compared to other parts of locking
(contention in general, and taking fat locks in specific), it is still
very fast.
For locks that are mostly uncontended, thin locks are great. There is
little overhead compared to no locking, which is good since a lot of Java
code (especially in the class library) use lot of synchronization.
However, as soon as a lock becomes contended, the situation is not longer
as obvious as to what is most efficient. If a lock is held for just a very
short moment of time, and JRockit is running on a multi-CPU (SMP) machine,
the best strategy is to "spin-lock". This means, that the thread that
wants the lock continuously checks if the lock is still taken, "spinning"
in a tight loop. This of course means some performance loss: no actual
user code is running, and the CPU is "wasting" time that could have been
spent on other threads. Still, if the lock is released by the other
threads after just a few cycles in the spin loop, this method is
preferable. This is what's meant by a "contended thin lock".
If the lock is not going to be released very fast, using this method on
contention would lead to bad performance. In that case, the lock is
"inflated" to a "fat lock". A fat lock has the following characteristics:
* It requeries a little extra memory, in terms of a separate list of
threads wanting to acquire the lock.
* It is relatively slow to take.
* One (or more) threads can register as queueing for (blocking on) that
lock.
A thread that encounters contention on a fat lock register itself as
blocking on that lock, and goes to sleep. This means giving up the rest of
its time quantum given to it by the OS. While this means that the CPU will
be used for running real user code on another thread, the extra context
switch is still expensive, compared to spin locking. When a thread does
this, we have a "contended fat lock".
When the last contending thread releases a fat lock, the lock normally
remains fat. Taking a fat lock, even without contention, is more expensive
than taking a fat lock (but less expensive than converting a thin lock to
a fat lock). If JRockit believes that the lock would benefit from being
thin (basically, if the contention was pure "bad luck" and the lock
normally is uncontended), it might "deflate" it to a thin lock again.
A special note regarding locks: if wait/notify/notifyAll is called on a
lock, it will automatically inflate to a fat lock. A good advice (not only
for this reason) is therefore not to mix "actual" locking with this kind
of notification on a single object.
JRockit uses a complex set of heuristics to determine amongst other
things:
* When to spin-lock on a thin lock (and how long), and when to inflate it
to a fat lock on contention.
* If and when to deflate a fat lock back to a thin lock.
* If and when to skip on the fairness on a contended fat lock to improve
performance.
These heuristics are dynamically adaptive, which means that they will
automatically change to what's best suited for the actual application that
is being run.
Since the switch beteen thin and fat locks are done automatically by
JRockit to the kind of lock that maximizes performance of the application,
the relative difference in performance between thin and fat locks
shouldn't really be of any concern to the user. It is impossible to give a
general answer to this question anyhow, since it differs from system to
system, depending on how many CPU:s you have, what kind of CPU:s, the
performance on other parts of the system (memory, cache, etc) and similar
factors. In addition to this, it is also very hard to give a good answer
to the question even for a specific system. Especially tricky is it to
determine with any accuracy the time spent spinning on contended thin
locks, since JRockit loops just a few machine instuctions a few times
before giving up, and profiling of this is likely to heavily influence the
time, giving a skewed image of the performance.
To summarize:
If you're concerned about performance, and can change your program to
avoid contention on a lock - then do so. If you can't avoid contention,
try to keep the code needed to run contended to a minimum. JRockit will
then do whatever is in its power to run your progam as fast as possible.
Use the lock information provided by JRA as a hint: fat locks are likely
to have been contended much or for a long time. Put your effort on
minimizing contention on them.

Similar Messages

  • Need details about Toshiba 15.4" Intel Duo Core 2 T5800

    Can anyone give me any information/review on this computer. I found it in a FuturShop store for 999.99$.
    However I can't seem to find any information about it online anywhere.
    I was told by a friend that it's a new special edition laptop or something. I need a tough computer as I do a lot of traveling and I will be using it for photos, music, videos, home financing, internet, excel, word, etc. Some games but not a main concern.
    Any info on the webcam, DVD burning capabilities, and expandibility would be appreciated.
    Below are some of the specs. I'm not too knowledgeable on computers so I hope I've given enough relevant info. Thanks in advance.
    4GB DDR2
    320GB Hard Drive
    HELP

    Well buddy, the most information and details about all actual Toshiba notebooks can be found on the Toshiba European page.
    http://eu.computers.toshiba-europe.com
    Here you should search in Laptops area

  • Need details about messageName

    I am using the following code to display a confirm message, once a new record inserted. This a program from the Tool Box tutorial.
    MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName),
    new MessageToken("EMP_NUMBER", employeeNum) };
    OAException confirmMessage = new OAException("AK", "FWK_TBX_T_EMP_CREATE_CONFIRM", tokens,
    OAException.CONFIRMATION, null);
    pageContext.putDialogMessage(confirmMessage);
    This is working fine. But I could not understand what are these values "AK" and "FWK_TBX_T_EMP_CREATE_CONFIRM". Do we need to configure these any where in the code?
    Please give me the details about this?

    Please see
    <JDEV_CLIENT_INSTALL_DIR>/jdevdoc/javadoc/fwk/oracle/apps/fnd/framework/OAException.html#OAException(java.lang.String, java.lang.String, oracle.apps.fnd.common.MessageToken[], byte, java.lang.Exception[])
    The arguments are "Application Short Name", "Message Name".
    You would need to define the message in FND Message Dictionary.

  • Need details about ECC upgrade

    Hi Gurus,
    Greetings..
    Need help on ECC upgrade
    We are currently on 4.0B system and upgrading to ECC 6.0
    Need details on the following
    1.) Can we directly upgrade from 4.0 to 6.0
    2.) What will be the system details ( like database os etc)
    Thanks in Advance
    Gopi

    Hi Gopi,
    according to SAP Product Availability Matrix you can upgrade directly from 4.0B system. Please check the link below:
    https://service.sap.com/sap/support/pam?hash=pvnr%3D01200615320900001296%26pt%3Dg%257Cr
    Please activate the check marks on the left side (pressing below link) to get an overview about supported OS/DB combination:
    https://service.sap.com/sap/support/pam?hash=pvnr%3D01200615320900001296%26pt%3Dt%257CPLTFRM%26ainstnr%3D012006153249000…
    Cheers,
    Andreas

  • Student need details about Business One prices.

    Hi
    I'm a german student and i have to do a project about SAP Business One. It's necessary for me to get more informations about the prices for this ERP software. I've searched the I-net for many days but couldn't find any helpfull informations.
    I need detail informations about asset costs, follow-up costs, license fees, costs for training the employers to handle the software and maintenance costs. If anybody can help me about that i will be very glad.
    greetings, daniel

    Well, first thing is the pricing is dependant on the country or at least the region you are buying B1 from. For example in Europe you could buy a SAP B1 license for 2500 euros when in Australia you can buy it for AUD2500 (FX rate 0.62).
    The price is based on the market, the performance, the index of investment etc.
    You also have to differenciate in your analysis the cost of licenses and the cost of implementing. Some partners are using a rule of thumb saying that the cost of implementation is roughly the cost of one license. I tend not to agree with it but that's a base I guess.
    Regards,

  • Need details about soap

    I am new ot soap technology . I am using apache axis soap .. Any body can give details about how to use the soap in the application .. For example I want to display the foot ball score in my website then in Germany they alreay provide the soap service then we request the service then get the score and then display that in website . my doubt is without knowing any thing first how to request the soap service provide in the Germany for Foot ball score and any body please give some sample codes and documentation

    Thank you for the request.
    Your Toshiba Virtual Store account 32651 has been reset.

  • Need details about Statistics - Internals

    Hi,
    I am aware of Statistics and how it helps CBO. I would like to know more about internals of Statistics, I know Oracle
    maintains certain details in the below views, also in Columns and Partitions Metadata views.
    DBA_TABLES
    DBA_TAB_STATISTICS
    DBA_INDEXES
    DBA_IND_STATISTICS
    I know it maintains NUM_ROWS and LAST_ANALYZED details in DBA_TABLES and DBA_INDEXES.
    Please provide details about the data being maintained in other views.
    I'm aware of Histograms, it maintains actual details about Data Distribution. I would like to know how the Normal Statistics differs from Histograms,
    it uses the same parameter method_opt with different values.

    845956 wrote:
    I know it maintains NUM_ROWS and LAST_ANALYZED details in DBA_TABLES and DBA_INDEXES.
    It actually maintains much more than just the NUM_ROWS and others you specified.
    DBA_TABLES
    DBA_TAB_STATISTICS
    DBA_INDEXES
    DBA_IND_STATISTICS
    Regards,
    P.

  • Need details about my account 32651

    PLEASE SEND ME DETAILS ABOUT MY E-MAIL AND PASSWORD.
    I HAVE LOST THEM. TKS.

    Thank you for the request.
    Your Toshiba Virtual Store account 32651 has been reset.

  • Tecra A50 PT634E - Need details about the SATA controller

    Hi
    I'm looking for detailed specification of Toshiba Tecra A50 (PT634E-00800JPL).
    I need to know what is the version of internal SATA port.
    Is this SATA II or SATA III ?
    I want to change the hard disk to SSD and buy the most suitable one.

    Install freeware hardware diagnostic software like for example SANDRA Sisoft, Everest Home Edit or HWiNFO32.
    Such tools provide you all essential information about the built in parts and the HDD controller.
    Please post some feedback would be interesting to know what SATA controller details would be reported by such tool.

  • Need Detail about DataInputStream()

    Hi,
    While I try to get an input using DataInputStream() and print the same using DataOutputStream(), I get the different value. I read that these methods uses Unicode format to handle the data, I need more explanation. I gave 23 as input but it prints 50 as output what makes this differences .

    From the DataInputStream API documentation:
    "A data input stream lets an application read primitive Java data types
    from an underlying input stream in a machine-independent way. An
    application uses a data output stream to write data that can later be
    read by a data input stream."
    Read the second sentence again.
    First write your data to a data output stream, then (and only then)
    use a DataInputStream to read it.
    If you search about these forums you will find detailed explanations
    of what happens when you wrap System.in in this strange way. But,
    really, this is not what a DataInputStream is for.
    Check out http://forum.java.sun.com/thread.jspa?threadID=695548

  • Need Details about "Morpheus"

    Hi All,
    can any one please let me know about "Morpheus" . this is the first time I heard this application name.
    so please send me the read -me docs for this.
    Thank you

    can any one please let me know about "Morpheus" It's excellent, highly recommended, though Uridium was better.
    so please send me the read -me docs for this.[Here you go|http://project64.c64.org/games/m-z/Morpheus.zip], but you shouldn't need them, just plug the joystick in and start blasting.

  • Need details about the Snap to Grid function

    I wanted to repair a problem in a guitar track, So I opened a new track and recorded over the problem. I though that with the Snap to Grid function I could slide the new version on the old track without having to worry about the region moving horizontally. That's what's happening, it is impossible to move the track without changing the timing of the track.
    Is it normal?
    Thanks in advance

    Install freeware hardware diagnostic software like for example SANDRA Sisoft, Everest Home Edit or HWiNFO32.
    Such tools provide you all essential information about the built in parts and the HDD controller.
    Please post some feedback would be interesting to know what SATA controller details would be reported by such tool.

  • Details about locking reason

    Hi all,
    is there any way to get the information why a user was locked in ABAP system via the connector? I would like to differentiate in IDM if the user was locked by the administrator or because of too many failed login attempts. I can see only the general information if a user is locked or not. But I need the locking reason code.
    Thanks in advance
    Jörn Kaplan

    Hello Jörn,
    I have something like this in my mind:
    Implement a class extending the ToSAP class, which is in the DSE.jar . For each needed method (initCustom, exitPass, add-, mod- and deleteEntryCustom) use super.xyz to call the method from the ToSAP.
    Then the class needs to write the locking reason to the desired place. I guess it could work somehow like this, but cannot think of an other possibility.
    The other possibility would be to file an OSS. But that could take some time, too.
    EDIT: Or is it possible to store the locking reason in the system? Then you only need to read that out and store it in the IS using a FromCustom pass after the pass that writes to the ABAP.
    Best regards

  • Need details about SAP-BASIS materials

    I am lerning SAP-BASIS.I need some url's where I can found basis materils.Please help me if any one know about this url's.

    Please note this is SAP Business One forum.  You can post your question on BASIS forum.
    Thanks,
    Gordon

  • Need details about the BI repository migration

    I have a requirement coming my way, although I am not working in Technology related to BI , my client insists me to do some BI repository migration.
    His requirement was that he has already done the cloning part of the DB, now all he wants is , the BI repository needs to be reproduced from the current server to another server.
    Kindly let me know any pointers for this BI repository migration.
    Thanks in advance.
    Regards,
    SID

    Hi,
    look if this is want you are looking for:
    http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/484161.htm
    Regards.
    Bruno Condemi

Maybe you are looking for

  • My ipad 3 sounds are not working please help

    Hi I have an ipad 3G wifi IOS version 5.1.1(9B206) modem firmware 1.0.11..once i plug my headset sounds work perfect but without the headset sounds doesnt work..not in you tube not in music nothing..but when i increase the ringing volume in settings

  • Help! My monitor can't display rendered things smoothly.

    I just installing a bootcamp for Windows 7 64bit. And after that my display turns out quite bad, the 3D things I see didn't rendered smoothly and the sharpness down. This happened in both my OSX and Windows. What happen? Did my VGA broke?

  • HOW TO TRANSFER DATA FROM CHAR TYPE TO NON CHAR TYPE

    HI EXPORTS,          THIS IS SASIDHAR, I HAD UPLOADED DATA FROM FLAT FILE INTO DYNAMICAL INTERNAL TABLE NAME <T_UPLOAD>. THIS INTERNAL TABLE FIELDS ARE CONVERTED INTO CHAR TYPE FIELDS. NOW I HAVE TO TRANSFER THIS DATA INTO ANOTHER INTERNAL TABLE  <DY

  • Calling Web Services form Custom Apps (11.5.7) Forms 6i

    Hi, My basic goal is to invoke a .net web service from a custom form. The web service is used to make a charge to a creditcard. I am currently using kind of convoluted method to achieve this. Below are the sequence of steps I do to achieve this 1) I

  • Themes in ITS

    Hi, I had created a executable program attached the same to a transaction. I want to publish this transaction. I published the same giving a theme as 90. In the attributes for the internet service i gave as ~theme 90. I wanted to change the backgroun