A way to avoid method inlining by JIT?

I've got a bit of code that relies on the accuracy of the stacktrace for a given call. When that code gets inlined by the JIT compiler (and thus the stacktrace altered), the behavior is no longer what I want because the class that called the method does not show up in the stack. For example:
class A {
main()
fooA();
public fooA()
fooB();
class B {
public fooB()
fooC();
class C {
public fooC()
getStackTrace();
// need to find out that class B called me
So in the example above, class A calls class B calls class C, and in the method fooC(), its imperative that the stacktrace show its caller as being class B. When JIT is disabled this is fine.
However, when JIT is enabled and this is seen as a hotspot, the code gets optimized and all of a sudden the stacktrace simply shows class A calling class C since the code in class B was inlined into A. Is there a way to make sure that the code in class B does not get inlined, or am I stuck with disabling JIT (which I don't want to do).
The obvious answer is to not rely on the stacktrace, but at this point in my application, that would require a major overhaul. Any ideas would be appreciated.
Thanks,
Charles.

If you're using the sun JRE, java has a '-Xint' option that forces interpreted mode. That'll stop the JIT from inlining.

Similar Messages

  • Interface method inlining

    hi
    I'm not sure, if this is the right forum to post to. Please move this thread to the correct one, if it is not.
    Here is my question:
    I want to write an "OpenGL wrapper-wrapper", that allows an abstract access to JOGL, LWJGL, etc. (for now only the two). This is only possible through an interface. In an OpenGL application there are many, many small calls to many OpenGL commands. So, if these methods are not inlined, the whole wrapper-wrapper doesn't make much sense.
    I could not find any clear documentation about it. Are such methods inlined by the JIT compiler? I'm using Java 1.5 and 1.6. I know, this question cannot be answered generally. But all these methods will look similar to these ones:
    Interface:
    public void glDoSomething(int foo, FloatBuffer bar);
    public void glDoSomethingElse(int foo);
    public void glEnable(int state);
    public void glDisable(int state);(e.g.) JOGL implementaion
    public void glDoSomething(int foo, FloatBuffer bar)
         // invoke the JOGL method in this implementation
        gl.glDoSomething( foo, bar );
    public void glDoSomethingElse(int foo)
         // invoke the JOGL method in this implementation
        gl.glDoSomethingElse( foo );
    public void glEnable(int state)
         // invoke the JOGL method in this implementation
        if (!gl_states[ state ] )
            gl.glEnable( gl_const_map[ state ] );
            gl_states[ state ] = true;
    public void glDisable(int state)
        if (gl_states[ state ] )
             // invoke the JOGL method in this implementation
            gl.glDisable( gl_const_map[ state ] );
            gl_states[ state ] = false;
    }Would this be inlined by Java 1.5 and/or Java 1.6? Is there any good documentation about this problematic? Is there any way to ask the VM about it?
    Any help is very appreciated.
    Marvin

    Well, the JIT compiler only inlines actual code. So you can't tell from an
    interface definition whether it will decide to inline an implementation of a
    method or not.Well, that's exactly, what my initial question was aiming at. I do know, that the implementing method is simple enough to be inlined. I just wanted to know, if the JIT compiler is even able to inline such code, that just implementes an interface. Is there any clear documentation about it?
    No, you're right. Why would the fact that interesting or annoying questions get replies lead you to think otherwise? The volunteers here answer whatever questions they feel like answering. If nobody finds yours interesting enough or konws enough about it to answer it, it may go untouched. Or maybe the handful of people who would be interested/qualified just didn't see it before others' questions came in and pushed it down the list. If you don't get an answer after several hours or a day, a polite bump just to push it back to the forefront is fine. Just don't get too impatient or people will start getting irritated and be more inclined to flame your for your bad manners than to help you.
    I'm very sorry, if I said anthing offending. Sometimes I do, even if I didn't want to. I was just wondering, if this forum actually makes sense in this way, if too few people are here, who answer questions. Believe me, when I say, that I do know, that it is (or can be) a hard job to keep track of all requests in a forum or even in a complete board. I will always be greatful for anybody, who takes up this work.
    But I am convinced, that my question is an interesting one not only for me. So I was wondering, how such a forum could ever fullfill its role, if quesions like this get flooded down to page 10 in such a short time. Many questions will stay unanswered, if they would need to be recognized in minutes to not get flooded on pages, where noone will ever look again for them.
    And further belive me, that this is not to be offending in any way. I just wanted to explain, why I was so shocked, that I wrote something like the above. Sorry, if this was misunderstandable.
    I could be wrong but I believe this already exists.I would be highly interested, if you could point me to where it already exists.
    Thanks.
    Marvin

  • Is there any way to avoid stop/start of tomcat when a java file is modified

    Hi all,
    we are developing a tool where we use java files for mediation layer and jsp files for presentation layer. so whenever i do a change in any of my java source i need to stop/start the tomcat in order to get the latest change.
    is there any way to avoid this kind of stop/start.... i want the changes to get reflected immediately after i compile the file.

    hai ,
    i wrote a sample test.jsp and TestJava.java file and i tried callin api getValue() in TestJava.java from test.jsp.then i did some modifications to this api i.e., i changed the return type from String to int . then compiled n also touched the file but the changes didn't get reflected instead i got the followin error.
    Location: /support/jsp/test.jsp
    Internal Servlet Error:
    javax.servlet.ServletException: com.adventnet.itm.common.TestJava: method getValue()I not found
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:475)
    Root cause:
    java.lang.NoSuchMethodError: com.adventnet.itm.common.TestJava: method getValue()I not found
         at jsp._0002fjsp_0002ftest_0002ejsptest_jsp_3._jspService(_0002fjsp_0002ftest_0002ejsptest_jsp_3.java:63)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:475)
    kindly help me ASAP.......
    Tanxxx in advance,
    Ani

  • I'm using a Canon HV20 video camera that uses digital tape. After importing to my Events Library in Final Cut X, there are some timecode breaks between clips resulting also in gaps between the clips. Is there a way to avoid this?

    I'm using a Canon HV20 video camera that uses digital tape. After importing to my Events Library in Final Cut X, there are some timecode breaks between clips resulting also in gaps between the clips. Is there a way to avoid this?

    Thanks Russ.  I'm a beginner but Lynda.com has a video on making an archive, so I'll follow her video to try this method.

  • Is there a way to avoid having a content library on a site server when the Distribution Point role is not installed on that server (disk cost issue)?

    Hello,
    I don't think it is possible, but my goal is to start a discussion about content libraries and maybe suggest something for a future release or version of Configuration Manager.
    Actually, based on Configuration Manager Technet documentation, Configuration Manager creates a content library on each site server and on each distribution point.
    Often, when designing the architecture, people will offload the distribution point role from the site server to an external server (and add the role to other servers too for redundancy). They could also do the same for the Management Point role, but this
    is not related to content library. The idea is to save the site server from having to deal with clients for software distribution (applications, software updates, OS, etc.), this is especially true for organizations having a large number of clients and/or
    primary site servers involved in a hierarchy. Doing so will allow more resources on the site server to deal with the database and also replication in the case of a hierarchy.
    When doing that, you still have to maintain a content library on the site server and the thing is this library will usually become huge, especially for organizations having more than 1000 applications (add also OS images to this). Will the content library
    on the site server become as huge as the one for a distribution point having a copy of all content? I guess the answer is yes.
    I know that Pull distribution points will help offloading the task from the site server to distribute content to distribution points, but, correct me if I'm wrong, you still have to maintain a content library on the site server when using them, and they
    will not make the content library smaller on the site server. Also, I don't like the fact that you lose the rate limits feature with Pull DPs, but this is another story.
    Storage cost is high and in this scenario, it hurts to have to pay this cost for a content library not used by the clients, but only to distribute content to DPs.
    Correct me if I'm wrong, but the key component here is Distribution Manager on the site server; this is the one which has to maintain a content library to do its job.
    It would be nice if we could have a way to elect a specific distribution point (not on the site server) as the Distribution Manager for a site, that main DP would hold a copy of all content by default, but would be used to distribute content to other DPs
    and avoid the content library on the site server. Said differently, the Distribution Manager component would become a site system role that could be transferred outside the site server.
    Tnx for comments, answers or suggestions.
    Patrick

    There is no way to avoid that the contentlib will be placed on the site server.
    I don‘t agree that storage cost is high. It might be true for fast storage, but that‘s not needed for it.
    Torsten Meringer | http://www.mssccmfaq.de

  • Is there a way to avoid image "compression/downscaling" on the iPad yet??

    Is there a way to avoid image "compression/downscaling" on the iPad yet??
    I'm sick of saving/downloading/transferring images to my iPad, only to find them being downscaled when saved to the device..
    Is anyone aware of a way to change this?? <edited by host> 
    I would very much like my images to remain the original resolution..
    Thanks!

    Nothing has changed. If your camera transfers raw images to the iPad, these are not touched. Copies that work with the iPad's resolution are also created during the transfer. When you sync with your computer the untouched raw images are what get transfered.
    But the iPad is a viewinf device, not a transfer device from computer to computer, so if you sync photos from your computer to the iPad, those are provisioned to the iPad's resolution.

  • I just purchased the I5, and use the same itunes as my wife. All my wifes contacts showed up on my phone. Is there a way to avoid this?

    I just purchased the I5, and use the same itunes as my wife. All my wifes contacts showed up on my phone. Is there a way to avoid this?

    She needs to call the carrier on her old iPhone and have it removed from her account.
    Once she does that you will not be able to use iMessage because that only works Apple to Apple.
    You will need to use something else like Skype instead.
    Allan

  • Is there a way to avoid a iPlanet Messaging Express home user to copy from the email message ( email content ) body and paste on to a local place( it Hard disk, for an ex )?

    Is there a way to avoid a iPlanet Messaging Express home user to copy and paste email body content and avoid attachment deliver attempts?Cause this could grant home users to take ownership of enterprise's documents, sending to them selves and after that, in their own homes, they access Messaging Express, recieve their email with the forbbiden content and then copy and paste to it's own's hard disk.

    It may be possible, but then what would prevent the user from running a "screen grabber" to capture the data. The underlying question that you need to ask is, "Who can you trust?" If you're concerned about confidential documents being stolen/disclosed, then that is where your security starts. If someone can't access a document, they can't E-mail it or transport it elsewhere. Who says they can only use E-mail? Using ftp is more efficient, or a floppy/Zip/Jazz drive could also be used. Trying to "secure" the E-mail client would be like plugging a single hole in a water pipe full of leaks. You have to shut off the water at the source.

  • When I send an email with Mail, I often confuse the account which I'm using. The result is that I send a message with the wrong account! Is there a way to avoid this (for example a reminder before the email is sent)?

    When I send an email with Mail, I often confuse the account which I'm using. The result is that I send a message with the wrong account! Is there a way to avoid this (for example a reminder before the email is sent)?

    Hi, thanks for the answer, I did that already. Unfortunatly this doesn't help me at all, as I often forget to check the menu. For me composing the message is writing the text, the subject, the person to who is addressed and than press "send".
    I often forget to check the "from", and this is a problem because the software select itself one of the accounts.
    Isn't there a way at least to put as a default a blank field instead of one of the accounts? or an account which doesn't work so if I forget to specify the "from" I will be rnotofied that the message can't be sent.
    I guess this could be a rather common problem for many people!
    Thanks
    Sergio

  • HT4137 Will doing this erase old text messages?  If so, is there any way to avoid losing them?

    I just looked read iOS: How to back up your data and set up as a new device.  I've been having a few bugs, but do not want to lose my old text messages.  Will setting up as a new device and then syncing erase old text messages?  If so, is there any way to avoid losing them?

    You will not lose text message, if you back up your phone correctly and then restore from that backup.  If your going to restore your phone as new and not from backup, then your text will not be there until you decide to restore from that backup.
    If you don't want to lose the message, take a look in the app store to see if you can transfer to your computer.

  • I just planned to install windows 7 on my MBP Mid-2012 using VMware Fusion,so i am bit panic about viruses and malware's affecting through vmware,is there any way to avoid from this??

    i just planned to install windows 7 on my MBP Mid-2012 using VMware Fusion,so i am bit panic about viruses and malware's affecting through vmware,is there any way to avoid from this??

    usamasheikh wrote:
    virus protection in vmware or on my running OS X 10.8.2??plz help me out
    First, you can install Microsoft's Security Essentials in the Win 7 VM and keep it up-to-date. Second, you can turn off Sharing in Fusion's System Settings to keep the VM environment separate from your Mac. Third, you can look into Sophos Anti-Virus http://www.sophos.com/en-us/products/free-tools/sophos-antivirus-for-mac-home-ed ition/download.aspx for the Mac host.

  • Have my MacBook Pro plugged into a monitor and also using a wireless keyboard. I want to close the macBook but every time I do the monitor turns off - is there a way to avoid this?

    Have my MacBook Pro plugged into a monitor and also using a wireless keyboard. I want to close the MacBook but every time I do the monitor turns off - is there a way to avoid this?

    Press any key on the wireless keyboard after you close the MBP and it goes to sleep. The computer will wake up with the external monitor as its display. This is called Clamshell mode.
    http://support.apple.com/kb/HT3131

  • What are the Ways to Avoid Email Tracking using Mail?

    Read KATE MURPHY's article in today's New York Times - "Ways to Avoid Email Tracking".
    I want to do this, but the article was not specific enough to Mail to explain how to do what she suggests in Mail preferences. (see text from article below)
    Any hints from people here?
    Thanx
    There are some things you can do to avoid having your email activity monitored. Perhaps the easiest defense is to adjust the settings of your email program so there is no image rendering.
    It used to be set that way by default but last year, in a boon to marketers, Gmail made the setting an opt-out feature and many other email providers followed suit. Disabling images will sift and block images from incoming emails, including those tiny, pixel-size tracking bugs. You can click on the missing images you want to see and which ones you don’t."

    Nevets,
    In Mail go to Preferences, then to Viewing
    See an option there to turn off remote loading of content
    I leave mine always off using the above dialog box.
    The email will go through to your mail box but the images will not follow unless you click an option in your mail box to load remote images - you can do this for each message.

  • Method Inlining in HotSpot VM

    Hello Folks,
    in the recent past I read a lot of posts and papers about method inlining in the HotSpot VM (especially method inlinings based on invocations via invokevirtual). From what I read the JVM is able to inline even such methods when there is only one class which implements the referred interface (since there is only one possibility for the dynamic type of the interface reference). These information might be true. But I want to see it with my own eyes. Is there any JVM option which makes it easy to profile when a method is inlined at runtime? I found that the option -XX:+PrintInlining would be the one I have to use. But when I try to enable this option while starting the JVM in debug mode the following error occurs: "Unrecognized VM option ''+PrintInlining".
    Does anybody know what is going wrong? The version of my JVM is 1.6 (which should support this option).
    I'm also interested in any information (preferred scientific papers) about method inlining in the HotSpot JVM.
    Thank you very much...

    Sorry...instead of invokevirtual I meant INVOKEINTERFACE.
    Is there noone who has some hints for me?

  • Way to avoid moving duplicates into a playlist?

    Howdy -
    I'm looking for a way to avoid moving duplicates into a playlist. If I have an established playlist, and I come across another song I'd like to add, I just drop it in there. If the song already exists in the playlist, the playlist happily accepts it with no warning. Is there some way to turn on a warning? (This is a duplicate of a song you already have in your playlist. Add it anyway? YES NO).
    I do realize that I can scan the playlist for duplicates after the fact, but it would be quite a bit handier to have iTunes alert me when I attempt to add a song that's already there. I wonder what percentage of the time a user would WANT the duplicate song in a playlist? I can see the value of it sometimes, certainly. And in that instance, you'd just say YES to the warning box (or select to never have it ask). Maybe this is a problem that's unique to me, but as I slowly build my playlist over many days, weeks and months - this feature would be very handy. My memory ain't what it used to be.
    Thanks.

    Well, there you go. Sure enough, 7.5 (the latest version today) does exactly what I'm looking for. What were the odds of that? Thank you very much for taking the time to reply... and having the answer! Solved.

Maybe you are looking for

  • Dreamweaver 8 not properly displaying php file in display area...

    Hi... I have made I new site... www.tresfjording.com It's all in Norwegian, but it seems to work fine in MSIE7 But in my Dreamweaver's design window it's a mess. In fact it shows just parts of the page and even that is garbled... Have installed WampS

  • Tagging character styles and paragraph styles in inDesign

    I'm working on a complex book in which everything on the pages is styled. I've been asked to tag the vocabulary terms in the text, so that the correct page number shows up in the index. I've been asked to tag the folios as well, for the table of cont

  • SQL "LIKE" statement isn't working right -- help please!

    Good day everyone, I thought about putting this in the "SQL on Oracle" forum, but it looked like those messages were geared more toward the Oracle platform itself, so here I am.  I apologize if this isn't the best forum. I have the following SQL stat

  • ITouch 2G upgrade to iOS 4.2

    I have the 2nd generation iTouch running IOS 3.1.3 and not able to find a way to upgrade it to IOS 4.2.   I have tried iTunes "check for updates" but it keeps saying that there are no updates available.   Model: MB376C.   Without upgrading, there are

  • Duplicate Dial Chart Values

    Hey Everyone, This must be easy to solve, but my searches have yet to reveal the answer. I just created a simple chart based on the average value from a table. Here is my source query: SELECT AVG(TIME_VAL) VALUE, 5 MAX, MIN(TIME_VAL) LOW, MAX(TIME_VA