Java Internals

Please tell me which is the best book for learning Java Internals -
JVM
Java Class File details
Execution details of Java Program, etc

This was all the info I needed to write a disassembler.... but it's far from easy reading... more of a reference than a developers guide.
http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html
But there seems to be a few books out there if you do a google search of
"java virtual machine book"
regards,
Owen

Similar Messages

  • Books on Java Internals

    Can anyone suggest me a good book on Java Internals.
    If my explanation is too lengthy,I apologise for that.
    1)If I say Iam instanciating an Object
    2)or using Collections,I need to know how these are exactly happening inside the JVM.
    Though I have 1 year of experience in Java,I need to know more elaborate on that.Can anyone suggest me a good book or link on this.
    Regds,
    Vidhya

    Can anyone suggest me a good book on Java Internals.You mean VM specifications?
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html
    If my explanation is too lengthy,I apologise for
    that.What if it is too short? :p

  • Need material on Java Internals

    Hi,
    I need to learn how the JVM works and how a java program is executed in a JVM.
    Can anyone provide me reading material on this topic.
    Thanks

    http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html

  • Libumem and java native leaks

    I'm diagnosing a native memory leak in a java process(not caused by a user JNI library, probably due to not closing some stream tied to native resources). I had used this technique before with some success, but this time I'm running into some problems. Basically what I'm doing is using libumem and mdb to help find the leak. I realize that these tools can give some strange results when looking at the JVM, but previously when I have it used, I can just focus on the leaked buffers with a large count and that pointed me right to the problem(the problem is bad enough that eventually I run out of memory space for the process...so I know the leak is being triggered repeatedly). The first problem I have is with libumem/mdb and the stack printed out through bufctl_audit which only displays symbol addresses for java routines. If it displayed the java symbol names, or if there were a way to make it display them then I wouldn't have much of a problem(though I've found I need to increase the audit size because of the large stack frame for a java process).
    So what I've done before is find the C library/routines where the memory is being leaked at, and then use dtrace to print stack traces for calls into that C library. Something like this:
    dtrace -n 'pid$target:libzip:ZIP_GetEntry:entry { @s[jstack(60,3000)] = count() }' -p <PID>
    This has pointed me to the right place in the past, because the place where the leak was happening was getting called frequently. The problem is with the current leak is this is much too course grained. The C library being called is being called quite often, so I'm getting way too many stacks, and sorting through to find the problematic one is difficult. Now if jstack() would show the java symbol name AND its address I could easily correlate it with what's in the findleaks/bufctl_audit output of libumem/mdb.
    Is there something I can do inside mdb to help find the java symbol names, or is there a way to use dtrace to correlate the java symbol name with its address to help me out here? I can do some rather ugly iterative stuff with dtrace where I don't give it a large enough buffer to print the whole stack trace and with small increases probably find the mappings from the java symbols to the address, but I was hoping there was something a little less painful. This of course needs to be diagnosed in a production system...so what I can do is somewhat limited. There is redundancy, so I obviously can for a short period pause execution on one server to grab the findleaks output and things like that. Thanks,
    Micah

    Since your question is about tracing Java internals, you might do better posting in a Java-related forum. (This forum is for Sun Studio, for developing in C, C++, and Fortran.) Try one of the forums listed under Java here:
    [http://forums.sun.com/index.jspa?tab=forums]
    and especially here:
    [http://forums.sun.com/category.jspa?categoryID=39]

  • Help me in finding the entry points in the source code of java.....

    hi...
    I want to design a compilation server and apply some of the optimization technique's like inlining, SSA and others.
    So i require to find the entry points in source code from where i can include my code and check the performance of the program at level it is performing .
    Please help in this problem....
    and i also like to know what are hot methods in java context?

    BigDaddyLoveHandles wrote:
    Do you even know Java? Why not just let the HotSpot optimization do its thing?Good point, I would try either of two things.
    If you have a good understanding of Java internals and are confident you could optimise code better, I suggest you contribute to the OpenJDK and we can all benefit.
    Otherwise I suggest you try using the optimisation built into the compiler and the JVM.
    Note: the JVM optimises the code dramatically in ways most normal people won't have thought possible.
    The compiler doesn't optimise the code so much as it leaves this job to the JVM.
    Two examples;
    - say you call a small method often. The JVM can inline this method for you. (the same way a compiler would) However say this method can be over-ridden and later your program calls a different implementation, it can inline both methods even if the new method in a new class didn't exist when the first method was inlined.
    - In a 32-bit JVM, 32-bit registers and references are used. In a 64-bit JVM 64-bit registers and references are used without needing to recompile the code. However there is a third option of using 32-bit references in a 64-bit JVM. In this case, it assumes the bottom 3 bits are always 000 so it shifts the reference down 3 bits allowing you to access 32 GB using 32-bit references. Again, you can use this with libraries which were compiled before 64-bit JVMs were available.

  • Assigning Thread priority according to CPU Usage

    I have a solaris server with several Applications running on different JREs
    As most of the time the CPU utilization is high, I am planning to change the priority of some of the tasks to lower from default, so that the High priority tasks can go ahead and finish their task execution.
    Please let me know using in Java how can I achieve that? Is it possible for Java to determine the priority of execution even though several JREs are involved?
    Thanks in advance,
    -Ajay

    First thanks to everyone providing me lots of information regarding OS & Java internals
    The problem that I am facing is,
    There are multiple applications running on one Solaris box say Application-1 and Application-2. Now due several design holes Application-1 eating up most of the CPU cycles(Not all the time but during upgrades, reporting etc) Please note Application-1 need to run no matter whether it is eating CPU or not.
    Now Application-2 is having two sub component
    1. Reading binary data from several clients (High priority task)
    2. Parsing those data(well performance tuned java code with high CPU utilization)
    In this above scenario if Application-2 sub component (2) runs along with Application-1 which consumes most of the CPU cycle then the whole system will be state to function.
    I know the answer will be to tune the code which eats the max CPU and fix the problem, but you need to consider this is one application of 7 years age and still the development is happening on top it.
    So only possible solution from my side to isolate the component I can reduce the priority of execution and wait till the component which can not be get delayed processing. Means yield Application-2 sub component &ndash; 2 for Application-1 to complete its processing.
    Sounds strange right? But I am not finding any other ways to solve this issue immediately
    So the solution I figured out is to have a component to check the System recourse Utilization and yield Application-2 sub component-2 till have enough CPU to proceed(Again I know it really a bad way to solve an issue)

  • Does making final field static improve performance or save memory?

    Are final fields given value at compile time by the compiler?
    private final String FINAL_FIELD = "31";
    Does making final field static improve performance or save memory?

    Actually it's final static fields with primitive or String type that are treated specially. For other final fields only extra compile time checking is produced, they are the same at run time.
    final static primitives are treated as compiler constants, and a literal value is substituted. No actual field is created.
    Myself I consider an awareness of Java internals valuable. For example, if you were unaware of the above the occasional misbehaviour of final static primitives referenced in other classes would be baffling. If your code references a final static primitive from another class it's compiled as a literal, not a reference, so if their value changes in the other class, the referring class will retain the old value if not re-compiled.

  • Handling database connections

    hi,
    is there a way to set up my jsp pages so that they don't have to connect and disconnect from the database everytime somone hits the page? i have a search page with a form that the user can search from and below that the results of a previous search, is there any way to optimize this? this page will be hit a lot, i was thinking about loading the data into a hashmap and displaying that rather than connecting each time, are there better ways, also the search results may be updated, new rows may be added into the database.
    Thank you.

    If u r using Tomcat, this might be what u r after.
    http://www.java-internals.com/code/resourcefactory/read
    e.html
    Hope it helps.Oops, this one below is actually better and i just got it worked a little while ago.
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html.

  • Assigning My Tasks according to Role Hierarchy

    Hi,
    I have to configure EP's <b>My Tasks</b> in such a way that Project Manager can assign the tasks to his team members but team member should not be able to assign the task to his Manager. i.e. I want to assign the task hierarchically.
    Can some one tell that how can I configure My Tasks for this requirement? I am using EP6.
    Thanks in advance.
    Manish

    First thanks to everyone providing me lots of information regarding OS & Java internals
    The problem that I am facing is,
    There are multiple applications running on one Solaris box say Application-1 and Application-2. Now due several design holes Application-1 eating up most of the CPU cycles(Not all the time but during upgrades, reporting etc) Please note Application-1 need to run no matter whether it is eating CPU or not.
    Now Application-2 is having two sub component
    1. Reading binary data from several clients (High priority task)
    2. Parsing those data(well performance tuned java code with high CPU utilization)
    In this above scenario if Application-2 sub component (2) runs along with Application-1 which consumes most of the CPU cycle then the whole system will be state to function.
    I know the answer will be to tune the code which eats the max CPU and fix the problem, but you need to consider this is one application of 7 years age and still the development is happening on top it.
    So only possible solution from my side to isolate the component I can reduce the priority of execution and wait till the component which can not be get delayed processing. Means yield Application-2 sub component &ndash; 2 for Application-1 to complete its processing.
    Sounds strange right? But I am not finding any other ways to solve this issue immediately
    So the solution I figured out is to have a component to check the System recourse Utilization and yield Application-2 sub component-2 till have enough CPU to proceed(Again I know it really a bad way to solve an issue)

  • Save Old-chinees with Unicode web app

    Hi all
    I was wondering if a Java web application that need to display / save text in Old-Chinese (utf8)
    How will be the text delivered to the DB without being sliced since the Java internals (String) is Utf-16
    Thank you
    Sharon

    UTF-16 already covers UTF-8. There's no need to worry about it.
    Just make sure that the whole process uses at least the same and the supported charset. Including the request, response and the database table.
    A very important read: [http://www.joelonsoftware.com/articles/Unicode.html].

  • How to check whether Java 3d is using hardware acceleration?

    Hi
    I just started looking into Java3d api. I am going through the tutorial examples. When I run it on Windows with JDK1.4.2, the app runs, but taskmanager shows cpu usage is around 55% of my 3GHz Intel processor.
    I am sending the following VM parameters
    -Djava.library.path=C:\progra~1\Java\Java3D\bin -Dj3d.rend=ogl -Dj3d.debug=true
    I tried Direct3D as well by passing -Dj3d.rend=d3d. I don't see much difference in cpu usage. The sample I am playing is the one where you create a ColorCube and rotate it on a timeline. Pretty straight forward code taken from the tutorial.
    I am wondering
    a) Why is my cpu at 55% if it is using h/w acceleration?
    b) Is there any way to find out whether Java is using software renderer vs h/w renderer.
    I used sys internals processexp tool to look at the stack of java thread that is spinning the cube. I don't see any references to opengl or j3d dlls in the call stack.
    I appreciate ur help.
    Thanks

    check this link, it queries the properties of your system:
    http://download.java.net/media/java3d/webstart/test/QueryProperties.jnlp

  • How not to use Cold Fusion and Java

    Overview
    This write up is intended to give java developers that are
    developing ColdFusion applications some beneficial information:
    things that are not documented.
    Scenario
    The company builds enterprise class web application software
    for fortune 500 companies. It had purchased a CF 7 based product,
    had and existing proprietary J2EE based product, and needed to
    integrate the two while meeting a host of new requirements. These
    requirements were based on delivering a better user experience,
    faster / cheaper integration, increased flexibility /
    configuration, useablily, decreasing maintenance costs, the ability
    to deploy in either install or ASP models. An initiative was
    started to create a new framework that integrated the best of each
    technologies. Tactically, this meant that we were to build a hybrid
    CF and java application: one that used building blocks (decoupled /
    cohesive components) that would allow applications to be rapidly
    assembled, configured and deployed. This made sense on several
    levels, the team was composed of Java and CF developers, the CF
    rapid application development was very productive, there is great
    functionality delivered in the CF platform and initial performance
    tests showed no cause for alarm
    The agreed upon design, based on requirements, and analysis
    by both the CF and Java staff has us using CF in the presentation
    layer, using a CF based MVC, use of CF based web services. The MVC
    was deployed using CFC inheritance for model objects and views made
    use of CF custom tags. The internals of the application, used a
    rules engine, some proprietary java, ORM, and other J2EE
    technology. The initial performance of the system was reasonable.
    We pushed on with product implementation.
    Then it was time to load test the application, and tune it.
    Under load the response times were orders of magnitude slower,
    sometimes the pages even timed out.
    Armed with our profiler, oracle execution plans and we
    charged ahead addressing issue after issue. Note that we took
    meticulous care in tweaking the active thread pool and ensuring
    that our CF setup was tuned for our application. None of the
    observations here are a condemnation of the language; rather they
    are aspects that, when considered together, not conducive for
    building integrated java and CF frameworks that use a structured /
    OO programming practices. Further detail can be provided on
    request.
    CFC inheritance should be avoided - resolution of variable
    scope is expensive even if properly declared.
    Since CF creates a class per method under the covers call
    stacks become very large, especially if used in a loop. This is
    nominally exacerbated by CF calls necessary to set up for the
    method call (String.toUpper()).
    Nesting of loops and if statements should be kept to a
    minimum - the conditional for each lookup of logical operator like
    LT, GT are synchronized. Under load this results in thread waits.
    Jrun has as single thread pool - both http and web service
    requests use the same pool. Under load this leads to thread
    deadlock. There are work arounds, but they are painful.
    Recursion should be avoided - we had a few recursive routines
    and these had to be rewritten.
    Custom Tags - should be used sparingly - each custom tag
    makes a synchronized call to the license server - (This may be
    fixed in CF 8)
    Summary
    In the end we got the performance to reasonable numbers, but
    we ended up moving some code to java (Custom Tags) and getting rid
    of 'good programming' practices (Inheritance, loops, etc), mandated
    proper variable scoping for those things left over. We prototyped a
    sans cold fusion implementation and had an order of magnitude
    improvement in performance and number of requests served per
    second.
    The lesson? Use Coldfusion in its sweet spot: make a query,
    iterate over the results and format for display. Extensive use of
    structure programming techniques or OO CFCs should be avoided: they
    will work but under load - but are better as a prototype. Building
    frameworks in CF? Think twice, no three times, and, if you must, be
    minimalist.
    Text

    interesting aslbert123,
    Not that I doubt you, but could you answer some questions
    about your implementation that was so slow:
    1.) Did you put your CFCs in the application or server scope?
    2.) Were you initializing your CFCs, via CreateObject or
    <cfinvoke>, on every request?
    3.) Are you sure that you were properly Var'ing every
    variable in your methods? (people typically forget about query
    names and loop iterator variables)
    4.) Could you give examples of how your inheritence was set
    up?
    5.) For CustomTags, did you call them the old <cf_tag>
    way or the newer, better-performing <cfimport> way?
    6.) How did you connect CF to Java exactly?
    Thanks,
    Aaron

  • Oracle BPM installed  Java out-of-memory exception

    Hi,
    I have installed the oracle BPM software in the server have the Ram capacity 8 GB,Could you please suggest some of the do's and don't's to avoid the Java out-of-memory exception which normally appearing on the console of weblogic server.
    My Server details,
    Windows 2008 R2 64 bit, RAM 8 GB,
    The required BPM s/w I installed from the link below,
    http://www.oracle.com/technetwork/middleware/bpm/downloads/index.html?ssSourceSiteId=ocomen
    Thanks in advance for your help.
    Regards,
    Shyam
    Edited by: user13821489 on 06-Feb-2011 22:45

    I had to increase JVM xmx/maxperm in the "set*Env.sh" scripts in the directory where you start WLS. In my dev environment, deploying BAM & BPM together with the Admin server, I finally allocated 4GB max. Jdev.conf is also better if you allocate > 1GB - mine is 1.4GB. I also watch process memory. Multiple re-deployments in my development environment seem to increase the memory, even if I remove process instances and undeploy first. I don't understand the internals very well so perhaps it is behaving correctly, but restarting WLS frees the unused memory that I expected gc to reclaim.

  • I've extended java.lang.Thread.  How do I get WebLogic to use my version?

    I want to add a String attribute to the thread class to save some extra info I need. I extended the Thread class with a private String with getter/setter methods.
    Since WebLogic instantiates the threads and not my own code, how do I get WebLogic to use my version of Thread instead of the one from java.lang?
    -Bill

    I don't think it's possible to have WLS use your own thread implementation for WLS internals. However, for your own custom work, it's pretty straight-forward to use the CommonJ Work Manager API and add your own implementation details for a thread pool.
    See documentation: http://download.oracle.com/docs/cd/E12839_01/web.1111/e13701/self_tuned.htm#i1069944
    WorkManager Javadocs: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13941/index.html?commonj/work/WorkManager.html
    Specifically providing your own Work interface implementation should hopefully allow you to meet your need.
    Edited by: james.bayer on Feb 15, 2010 6:40 AM

  • Java Beans in 11g !

    Hi everyone,
    We are using 11gr2 Forms/Reports 64-bit on Windows Server 2008 64-bit.
    Now we want to use JAVA BEANS in our application.
    Suggest me link and steps for installing/using JAVA BEANS compatible for 11gr2 Forms/Reports.
    Kindly tell me benefits of using JAVA BEANS in our applications.
    Thanks vth Regards.
    Bhatt.

    Advantage of java beans is you can enhance the behavior of forms. Forms is as you know applet based running on the client. (There is a different technology associated with inserting your own java code into the loop on the application server, should you want to do that.) So with beans in theory you can get more code to run on the client and do things like read and write files on the client, communicate with devices on the client, etc.
    Regarding doing that I think the executive summary is mostly look up Fbean in forms builder help.
    How I came to that tentative conclusion (I haven't gotten mybean to work yet! What do I know?) follows.
    Home of much forms info:
    http://www.oracle.com/technetwork/developer-tools/forms/overview/index.html
    Java beans are java obviously one has to acquire a certain level of expertise in java to deal with them but more importantly how to understand how to communicate between forms and the bean? It's hard for formists, living their lives at the outside of forms, who come up with an idea of something exceptional they want to do in forms, to translate that into the bean world. Then you have to think like a form and that's unknown territory.
    One problem is terminology: what is a PJC and what is a bean? Is a bean a PJC? I have yet to definitely figure that out. The paper below says: "A javabean is a pjc which is of an unspecialized type". However after that was written seems like in many cases when people are referring to "pjc"'s they are thinking the pjc is a specialized type.
    "Oracle9i Forms provides two mechanisms for extending the client with Java. The
    Pluggable Java Component (PJC) mechanism, which was introduced with Forms
    6i, and the newer Oracle9i Forms specific, enhanced JavaBean support
    mechanism." (paper 2 below).
    I was reading this document from 2000 which is interesting:
    Paper 1:
    http://www.oracle.com/technetwork/developer-tools/forms/documentation/269054-130573.pdf
    It's talking about handlers and views and it's quickly getting over my head as I don't know enough forms internals to make much of this. For example I would like to write a bean that can print a small form. I have a proof of concept in java (6) that can print text to the default printer. So next step, create a bean that can get the data out of the form. From my formist perspective here I am in a bean how do I access some fields in a record in a block in forms? It's tough going. What does that mean in this handler/view world? Or do I have to be in the form and think of sending data to the bean and telling it to print it?
    Paper 2:
    http://www.oracle.com/technetwork/developer-tools/forms/documentation/269054-130573.pdf
    Starts out with more on the handler/view thing. Unfortunately I am totally mvc or handler-view impaired. It escapes me totally.
    "The Handler class is responsible for both maintaining the current value of any data and controlling the visual representation of the data."....vs.... "The View class is singularly responsible for presenting the data to the user in some
    manner and handling user input. The View class may allow the data to be changed
    by the user.". What? I am lost I have no idea what the handler does and what the view does. How about a discussion that is strictly goal oriented? If you want to do this, you have to talk to the (Handler| View)? Don't leave it to me to understand the handler/view thing and then figure it out from that. (This mvc thing is precisely what repels me about jdeveloper. You can't embrace jdev if you haven't drunk the mvc koolaid.)
    Further on in the paper they bring up fbean:
    "So in Oracle9i Forms a new simpler mechanism was introduced to allow you to integrate JavaBeans and Java
    Applets as custom components without writing any Java Code at all. This is all handled using a PL/SQL package in Forms called FBean.
    "FBean provides a full PL/SQL API to allow interaction with any public methods,
    properties and events that a JavaBean or Applet exposes."
    Now you're talking! This is more like it!:
    "Executing Methods
    Methods on the JavaBean are executed using one of the variety of
    FBean.Invoke methods. Like the property getters and setters there are various
    versions of this method which handle calling methods on the JavaBean that return
    different datatypes (or return void):
    • FBean.Invoke_Char()
    • FBean.Invoke_Bool()
    • FBean.Invoke_Num()
    • FBean.Invoke()
    Ok now that we know about the fbean thing we can find fbean in the forms builder help system. Looking good. I am pretty sure that somewhere in there you have to get your bean in a jar file and sign it (not a trivial proposition) and
    change the forms server configuration to include your jar file. I also think that the bean has to import frmall.jar and some of the packages regarding that view stuff. A tutorial about fbean and all these details from start to finish would be super!
    So you can talk to another applet? Really? Can this still be done considering all the security concerns in current browsers?

Maybe you are looking for

  • ICC Profiles for papers and not for HP printers.

    Hello, I apologize if this has been asked a billion times before, but I have been trying to find the ICC profiles to install for a different printer.  I am not using a HP printer, but a Canon iP6000D.  Let me explain, I'm a student and my class requi

  • Crop Marks not in correct place when Bleed applied - possible Bug/Error?

    Apologies if anyone has posted this elsewhere - I checked the Help, FAQ, Forums and Googled it - but I really can't find a solution to this minor problem I'm having. I have created a document that will be cut to 120mm x 120mm, I wanted to include a 1

  • Image issue when printing

    I use Adobe Acrobat 9 Pro. In my job I am responsible for training materials. I often convert pptx or docx into pdfs and never had a problem with images but now I do. PDFs show as being successful and everything looks good on the screen but once I pr

  • Motion to final cut quality loss

    Whether round tripping or exporting, gfx involving logos I'm creating in motion look great in motion. As soon as I put them in the FCP timeline, logos look ragged and grungy. Any thoughts as to why this is happening?

  • Error on task manager BPEL 10.1.3.4.7 - oc4j

    Hi, I'm having problem with Task Manager on bpel 10.1.3.4.7 using oc4j, cluster environment. The following errors appears on error log intermittently, if I try to reprocess the same bpel process it works: ERROR> <segmentacao.collaxa.cube> <BaseCubeSe