Is the JVM aware of some classes?

Hello,
I am digging into java events. I decided to start with the Java 1 Event model. (I know it is deprecated and I should not use it in a production environment).
I built a simple class that extends "java.awt.Frame" and overrides the "handleEvent" model.
It works fine and I assume the event generated comes from the JVM (Am I right?).
My question is: Is the JVM aware of the Event class? If not then how does it passes the Event object into the handleEvent method?
Thanks in advance,
Balteo. (This is repost)
Here is my class
import java.awt.*;
import java.awt.event.*;
public class CaptureTouches extends Frame {
CaptureTouches(){
this.show();
this.pack();
public boolean handleEvent(Event e){
switch(e.id){
case Event.KEY_ACTION:return true;
//catching some events/keys
switch(e.key){
case Event.F1:System.out.println("F1");return true;
case Event.F2:System.out.println("F2");return true;
case Event.F3:System.out.println("F3");return true;
case Event.F4:System.out.println("F4");return true;
case Event.F5:System.out.println("F5");return true;
case Event.F6:System.out.println("F6");return true;
case Event.F7:System.out.println("F7");return true;
case Event.F8:System.out.println("F8");return true;
case Event.F9:System.out.println("F9");return true;
case Event.F10:System.out.println("F10");return true;
case Event.F11:System.out.println("F11");return true;
case Event.F12:System.out.println("F12");return true;
default: System.out.println("Other event");return true;
public static void main(String[] args){
CaptureTouches ct = new CaptureTouches();
******************************

It works fine and I assume the event generated comes from the JVM (Am I right?).No, it's wrong. All events are generated by AWT (usually in peers).
May be you should read some tutorial about AWT (there was one on Sun's site).

Similar Messages

  • Some baisic  quesetion about the jvm

    1 I want to know if more than one application can share one jvn or each has one>?
    For example ,in the web application I am using tomcat as the web server ,my web applicaion is a web service, so when the tomcat start up,a jvm start up to ,when a client send a request to the server ,then my application(the web service) will handle the request and call some classes, now these classes work in the jvm created by the tomcat or new jvm?
    2 what does System.exit(0) stand for?
    if in a jsp page , some one write " System.exit(0) ",the web server can still work ?

    I am the one who ask this problem.
    Now ,I have make the jvm problem clearly. But what confusing me is that " the tomcat shun down when some commond error". More details can be found in the following :
    In my web application(the web service I mentioned above),I have a class(MainClass) to call some commond by the java.Runtime interface, and the MainClass have two memebers ThreadResult and ThreadError both of which is a Customized thread class extends the java.lang.Thread. As their class name show, the ThreadResult is to get the result, and the ThreadError is to get the error if exist.
    In practice,when the commond is invalide,from the log files I can get the messages fired in the ThreadError class,that's to say the ThreadError works,and it obtain the error messages and write it to the log file, but I can not understand the following -- the tomcat shutdown !
    So I ask the question about the jvm to make sure whether the jvm is one.
    And from the above reply I know the jvm in which the tomcat works is the one in which my web application works, so I guess maybe something wrong occurs in my web application which call the tomcat shut down. I have check the MainClass and ThreadResult and ThreadError class and there is no word like"System.exit()" . It seems that there is no reason for the stop of tomcat but it does.......
    I have no idea now....

  • Is a way to get some classes loaded?

    I run into a problem today. After the main class is up, a "java.lang.NoClassDefFoundError" exception is thrown while running. The class is located in the same directory as the main class.
    After I turn on the verbose option, I find the class is not loaded at the point when the main class is up. Although it is loaded after the exception occurs, the exception still occurs.
    I guess for the limited memory reason not all classes are loaded. Is any way I can get some classes loaded first?
    Thanks for your input.
    v.

    This will not help you current problem, which sounds like either a class path problem, but
    Is any way I can get some classes loaded first?To get a class to be loaded by the JVM, you can use Class.forName("class name"). To force it to load early in the application life (not first, as the main + Java classes will come before it) use the static initalizer, i.e.class Main {
      static {
        Class.forName("Jeff");
    }Your second, unloading class, is it packaged correctly? And has it be compiled?

  • What is the exact mean of  classname.class.

    what is the exact mean of classname.class. what situations it will be use ful . how to use . give me one example .

    Each class, interface, or enum loaded into the JVM has an associated Class object. This contains a lot of information about the class in question, including lists of fields and methods. <classname>.class gives you a reference to the Class object of the class mentioned.
    See the java.lang.Class javadocs for all the things you can do with a Class object.
    For example:
    theImage = new ImageIcon(MainClass.class.getResource("item.png"));to retrieve an image file from the directory containing the MainClass class file.

  • Why some classes are not Cloneable?

    I found the library designers designed some classes that are not Cloneable, such as String,StringBuffer, File, Thread, Socket...
    Since File,Thread and Scoket contain information of the context, they may not work as expected if I transfer them to other hosts~~
    But why StringBuffer isn't Cloneable?

    It is Serailizable objects which can be transferred to another system.
    StringBuilder and the older StrinBuffer are Serializable but not Cloneable.
    I don't know why StringBuffer is not Cloneable, but I would not recommend you use clone() for any object except primitive arrays and I cannot think of a good used for cloning it. ;)

  • How to get name of class that the JVM was started with ?

    Assume I have class foo with the standard main method.
    I also have classes ding and dong, they extend foo.
    The JVM is started with either ding or dong as the 'main' class. Since neither ding nor dong directly implement main, the actual main method being executed is foo's.
    In the main method of foo I want to construct an instance of either ding or dong, depending on which the JVM was started with. Since I'm in a static context, I can't do anything with 'this'. Is there another way to get the name of the 'main' class from the JVM so that I can construct an instance of it ?

    The idea behind all of this is that the developer of
    Ding and Dong should not have to know anything about
    foo, in particular it's constructors. But if Ding and Dong are subclasses of Foo, then developers must know about Foo. If you expect developers to extend a framework without having a well-defined interface to that framework, you are probably heading for trouble.
    To be able to
    privatize the constructors, construction of the
    concrete class has to take place in foo.If Ding and Dong are subclasses of Foo, then you can not make all of Foo's constructors private.
    Of course I could have a method in Ding and Dong that
    calls a static method in foo into which the Ding and
    Dong instance pass their class, but then I'd have
    identical implementations of this method in Ding and
    Dong. Yes you would (well, not identical, but very similar). Like I said, you could do this programmatically with AOP, or you could probably do it dirtily using stack traces (though with it being a single hit at startup, you might not consider it being quite so dirty).
    But: the point of inheritance is that common
    functionality goes into superclasses. I disagree. The important thing about inheritance is that classes share an interface, and that methods can be polymorphically inherited, allowing new functionality to be 'plugged in' in the future, and even at runtime.
    Also, in
    general one wouldn't make methods static if a class
    reference is needed (or one would make it an
    argument), but Sun didn't consult me when they
    designed the main method :-(I still don't see why you need to do what you want to do. It appears that all you are after is the ability to start your program using a command line like
        java com.mypackage.Ding
    instead of
        java com.mypackage.Foo com.mypackage.Ding
    or
        java com.mypackage.Foo Ding.properties
    or something else along these lines.
    Since you must know the name of the class you want to use at the time you want to use it, why can't you just pass the name as an argument, or start up using some properties file, or a shell script?

  • Get some informations on the JVM : compile time, loading time

    Hi everybody,
    I'm running a simple jar application in command line that :
    - starts
    - calculates something
    - stops
    It's a simple test :D
    I would like to get some informations :
    - the number of loaded classes
    - the time spent to load / compile classes
    Typically, it's the TotalLoadedClassCount and the TotalCompilationtime in JConsole
    Do you know a software to do it ?
    Thanks for your help
    Obelix

    Hi,
    I did some tests (powerPC603E 266hz/ 128Mo RAM / 64Mo ROM)
    and I think that obfuscation has an good impact on loading classes only !
    Please see the folowing results with a non obfuscated jar :
    time java -jar none_obfuscated.jar
    =====================================================================
    Test with 'none_obfuscated.jar' (4.8M)
    =====================================================================
            - GoodMorning...
            - Start your job at 19:52:45
            - You must work today (load 2000 classes)
            - Stop your job at 19:54:11
            - GoodEvening...
            - You worked for 85.934s today
            ==>> TotalCompilationTime  : 2.731s
            ==>> TotalLoadedClassCount : 2468
    real    1m 30.26s
    user    1m 27.55s
    sys     0m 2.66s
    =====================================================================and with the same jar but obfuscated :
    time java -jar obfuscated.jar
    =====================================================================
    Test with 'obfuscated.jar' (4.1M)
    =====================================================================
            - GoodMorning...
            - Start your job at 19:54:16
            - You must work today (load 2000 classes)
            - Stop your job at 19:55:39
            - GoodEvening...
            - You worked for 83.392s today
            ==>> TotalCompilationTime  : 2.721s
            ==>> TotalLoadedClassCount : 2468
    real    1m 27.75s
    user    1m 25.04s
    sys     0m 2.65s
    =====================================================================I did 3 times this tests and I can notice this :
    - no differences for TotalCompilationTime
    - no differences for TotalLoadedClassCount (of course)
    - a difference of 2.54s for working time (load 2000 classes)
    In conclusion, obfuscated code increase, a little bit, the loading classes but not the compilation time !
    We can calculate the starting time of the JVM :
    - none obfuscated : 1m 30.26s - 85.934s = 4.326s
    - obfuscated : 1m 27.75s - 83.392s = 4.358s
    What do you think about it ?
    Thank for your help.
    Obelix
    Edited by: obelix on Jul 29, 2008 3:02 PM

  • How does the JVM handle private class parameters in a utility class?

    If I have a class that is public and not labeled as static, but it's constructor is private so that it cannot be instantiated, and all of its parameters and methods are both private and static. The methods modify the private parameters. In this case, the code explicitly is avoiding a singleton pattern, so there isn't even a class being instantiated, so this is a true utility class.
    However, the static methods are accessible from multiple objects, and as far as I can tell, the JVM is persisting the parameters in memory beyond the specific thread that called the static method to begin with.
    The question I have is how the JVM handles this? Are these private parameters assigned memory and are indeed persisted independent of thread, since there is no class reference. I am working with byte code injection, and the assumption is that a direct reference to a static parameter is much faster to call than having to go through an object reference. Of course, from a programmer point of view, I much prefer the singleton pattern since I am so used to hang my hat on a class reference.
    Thanks.

    entguru wrote:
    However, the static methods are accessible from multiple objects...Not if the methods are private, as you seemed to indicate ("all of its parameters and methods are both private and static").
    Are these private parameters assigned memory and are indeed persisted independent of thread, since there is no class reference. There is a class reference. It refers to the class, and is obtainable via the class literal; e.g., MyClass.class.
    ~

  • [svn:fx-trunk] 15810: * Package and class level javadoc for the antTasks module and some

    Revision: 15810
    Revision: 15810
    Author:   [email protected]
    Date:     2010-04-29 02:47:22 -0700 (Thu, 29 Apr 2010)
    Log Message:
    Package and class level javadoc for the antTasks module and some
      other stragglers.
    QE notes:
    Doc notes:
    Bugs:
    Reviewer: Corey (post commit)
    Tests run: checkintests
    Is noteworthy for integration: NO
    Modified Paths:
        flex/sdk/trunk/modules/antTasks/src/flex/ant/AsDocTask.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/AscTask.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/CompcTask.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/FlexTask.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/HtmlWrapperTask.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/MxmlcTask.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/ConfigAppendString.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/ConfigBoolean.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/ConfigInt.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/ConfigString.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/ConfigVariable.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/NestedAttributeElement.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/OptionSpec.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/RepeatableConfigString.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/DefaultScriptLimits.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/DefaultSize.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/FlexFileSet.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/Fonts.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/Metadata.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/RuntimeSharedLibraryPath.java
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/URLElement.java
        flex/sdk/trunk/modules/compiler/src/java/flash/css/LocalSource.java
        flex/sdk/trunk/modules/compiler/src/java/flash/css/URLSource.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/linker/DependencyWalker.java
    Added Paths:
        flex/sdk/trunk/modules/antTasks/src/flex/ant/config/package.html
        flex/sdk/trunk/modules/antTasks/src/flex/ant/package.html
        flex/sdk/trunk/modules/antTasks/src/flex/ant/types/package.html

    Thank you very much!
    I cant believe this little comment has been so helpful!
    But yes it is:
    I explain, despite my efforts to find, googled it, forums, faqs, etc...
    no where it mentionned the manifest.fm file is... INSIDE the .jar!
    Your comment "a zip" made me attempt to open it with winrar, and I found a manifest.fm file inside!
    So far I was editing the one at the "source" of my project and rebuilding it with netbeans.
    I am going to try that now.
    Actually.... :( no its mentionning my main class!
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 10.0-b19 (Sun Microsystems Inc.)
    Main-class: courseworkjava3d.Simple3D
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildWell I have no problems uploading you the .jar, it is for a coursework it is not a private project or whatever:
    http://www.uploading.com/files/CM2LKWYU/BetaCourseworkJava3d_Final.jar.html
    Oh and I felt on your comment "dont ask us" as if I was suppose to know... i'm a beginner, I did not know that! And I tried to give you so many infos so you dont lose your time if you want to help, especially as after my own research I found many, many results for this "main class" and I tried a few solutions!
    Edited by: CupofTea on Apr 13, 2008 3:28 AM

  • Setting the CLASSPATH from the JVM by a class

    Hy experts
    I have an application thats searching a jar file and have to access classes from this jar file.
    There are two ways to do this:
    1.
    Loading the jar file byte by byte and create the classes to load them into memory. This is the hard way.
    2.
    Setting the CLASSPATH variable in the running program! Thats the easy way! May how does it works?
    Is there any possiblity to set the classpath in a running application or only in the shell?
    Thanks for help
    konrad

    the classpath is readin when you run the JVM ie issue the 'java' command, the environment cant be altered to update a new classpath. However, why not just put the files you wish to load at runtime within the current classpath you've setup. If you use the System.loadLibrary(), you should be able to pick up the classes you wish to readin at run time via this approach.
    good luck
    rob

  • How to remove a static class from the Runtime of the JVM

    I want to remove a static class from the Runtime of the JVM.
    My goal is to clear the cache of the "InetAddress.getByName(String host)" static method.
    Thanks in advance.
    Floweb

    Sorry, It means a class that has been loaded in the JVM by the call to a static method......
    Floweb

  • PROOF !  Classes can be unloaded from the JVM.. do you agree????

    this post shows you can unload a class from the JVM... do you agree?
    http://forum.java.sun.com/thread.jsp?forum=4&thread=327315&tstart=0&trange=15

    If you say "effectively", I would agree. Once the old classloader, the old class, and all old class instances are no longer reachable, then for all intents and purposes (except memory consumption) it is unloaded.
    Of course, it's up to the JVM implemention to decide whether (if at all) and when to gc that stuff.

  • Is the remote interface implemented by some class

    Hi,
    I have a simple question, googled, no help.
    I am trying to udnerstand, where exactly is the remote interface implemented ?
    I mean, i know that it contains all the business methods which have a body in the bean.
    But is the remote interface implemented somewhere ? Is there any class which implements the Remote interface ?
    thanks
    S

    Sarvananda wrote:
    Hi,
    I have a simple question, googled, no help.look better...
    I am trying to udnerstand, where exactly is the remote interface implemented ?
    I mean, i know that it contains all the business methods which have a body in the bean. so, that's what implements it :)
    But is the remote interface implemented somewhere ? Is there any class which implements the Remote interface ?
    the bean class :)
    But the actual implementor is a class generated by the appserver that delegates to the bean class.

  • On the printing slowness of Postscript produced by the JVM from calls to Graphics.drawString() (Linux/Unix)

    Happy new year,
    before the holidays my attention was drawn to an issue that supposedly the Postscript produced by the JVM is too big and hence too slow.  Here are my findings.
    The issue
    Text printing via CUPS to native Postscript printers can be slow. Printing a terms and conditions page (17000 characters/page) takes three and a half minutes to print on a Dell 2330 dn laser printer (96 MB,Max speed 33 ppm). The file is about 8 MB in size. To contrast that, rendering the text to a buffered image with 300 DPI and printing the result produces 7 MB of output which prints in 30 seconds on the same printer. More measures for different printers and documents can be found at the end of this post. The issues is registered as  "JDK-4627340 : RFE: A way to improve text printing performance for postscript devices" (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4627340) and the proposed workaround is to use printer fonts.
    Side remark regarding the workaround
    There is a regression that prevents the workaround from working (bug 9008662 at Sun (not yet visible),  bug 8023990 at OpenJDK (https://bugs.openjdk.java.net/browse/JDK-8023990). Without knowing what other bad side effects this might have, the issue can be resolved by setting the property "sun.awt.fontconfig". On my system I set it to the location of a "fontconfig.properties" of a JVM that does not have the bug (e.g. /home/alex/openjdk_7_b147_jun_11/openjdk/build/linux-i586/bin/java -Dsun.awt.fontconfig="/etc/java-6-openjdk/fontconfig.properties" Print2DtoStream). I also successfully tested the workaround on an Oracle JVM 1.7.0_03-b04.
    Back to the main topic
    How the JVM draws text if it can't use a standard printer font
    Text is drawn with postscript path drawning commands such as "moveto", "lineto" or "curveto". As an example consider the word "ll" which looks something like this:
    %N->short for "newpath"
    N
    %paint first "l"
    %M->short for "moveto"
    0.76875 11.06 M
    %L->short for "lineto"
    0.76875 2.468 L
    1.823 2.468 L
    1.823 11.06 L
    0.76875 11.06 L
    %p->short for "closepath"
    P
    %paint second "l"
    3.649 11.06 M
    3.649 2.468 L
    4.703 2.468 L
    4.703 11.06 L
    3.649 11.06 L
    P
    The same text could be printed with a printer font using the command "(ll) show" which is much more compact but is available in Java only for the Postscript standard fonts and it isn't working at all right now as explained above.
    Is it the file size?
    My first thought was that the file size was the source of of slowness and so I wrote a small processor that would detect glyphs, normalize*1 them and place them in a dictionary. Recurring references to the same glyph were replaced by a dictionary reference  (This is incidentally the fix proposed by the original author of RFE 4627340). This shrunk the file to about 11% of the original size but the processing time surprisingly doubled.
    *1: With "normalizing" I mean applying a translation transform so that the smallest coordinates in the contours of a glyph are exactly 0. In addition I experimented with performing a normalizing scale transform so that all coordinates lie between 0 and 1 so that identical glyphs are detected at arbitrary positions and at different font sizes.
    That led to the question to why there is such a big difference in performance between a Type 1 font dictionary and a self constructed dictionary since both contain basically the same drawing instructions. The difference is apparently that fonts are cached and user drawings are not unless explicitly told.
    The Postscript "ucache" instruction
    Postscript level 2 introduces the "ucache" instruction which seems to be defined for precisely this kind of problem. From the documentation:
    "Some PostScript programs define paths that are repeated many times. To optimize the interpretation of such paths, the PostScript language provides a facility called the user path cache. This cache, analogous to the font cache, retains the results from previously interpreted user path definitions. When the PostScript interpreter encounters a user path that is already in the cache, it substitutes the cached results instead of reinterpreting the path definition. "
    After adding "ucache" instructions to my filter the speed improved by factor 10.
    To illustrate the said the "ll" text from above looked as follows after the transformation:
    %definition of the glyph "l" named "p0"
    /p0
    ucache
    0.000 0.000 1.054 8.592 setbbox
    0.000 8.592 moveto
    0.000 0.000 lineto
    1.054 0.000 lineto
    1.054 8.592 lineto
    0.000 8.592 lineto
    closepath
    } cvlit def
    G
    N
    0.769 2.468 translate
    %draw "l" at 0.769 2.468
    p0 ufill
    -0.769 -2.468 translate
    3.649 2.468 translate
    %draw "l" at 3.649 2.468
    p0 ufill
    -3.649 -2.468 translate
    For ucached shapes there is a special compact representation so that the same can be written as follows:
    /p0
    0.000 0.000 1.054 8.592
    0.000 8.592
    0.000 0.000
    1.054 0.000
    1.054 8.592
    0.000 8.592
    } cvlit def
    G
    N
    0.769 2.468 translate
    p0 ufill
    -0.769 -2.468 translate
    3.649 2.468 translate
    p0 ufill
    -3.649 -2.468 translate
    Interestingly the speed improvement remained the same on a Chinese report that had hardly any character reuse. Upon this observation I changed the filter to not use a dictionary but so simply instruct the interpreter to cache each glyph definition and the performance remained nearly the same.
    The initial "ll" text from above looks as follows after this transformation:
    N
    %paint first "l" cached
    0.76875 2.468 1.823 11.06
    0.76875 11.06
    0.76875 2.468
    1.823 2.468
    1.823 11.06
    0.76875 11.06
    } ufill
    %paint second  "l" cached
    3.649 2.468 4.703 11.06
    3.649 11.06
    3.649 2.468
    4.703 2.468
    4.703 11.06
    3.649 11.06
    } ufill
    Note that I didn't normalize the shapes.
    Why does this improve the performance so vastly if the shape is drawn only once? For a while I thought perhaps that the interpreter would consider two paths which differ only by a translation as being the same but rereading the documentation and looking at the Chinese example in which nearly all characters are unique, disproves this. The relevant part of the documentation reads:
    "Caching is based on the value of a user path object. That is, two user paths are considered the same for caching purposes if all of their corresponding elements are equal, even if the objects themselves are not.
    A user path placed in the cache need not be explicitly retained in virtual memory. An equivalent user path appearing literally later in the program can take advantage of the cached information. Of course, if it is known that a given user path will be used many times, defining it explicitly in VM avoids creating it multiple times.
    User path caching, like font caching, is effective across translations of the user coordinate system, but not across other transformations, such as scaling or rotation. In other words, multiple instances of a given user path painted at different places on the page will take advantage of the user path cache when the current transformation matrix has been altered only by translate. If the CTM has been altered by scale or rotate , the instances will be treated as if they were described by different user paths."
    An explanation that would fit the findings
    The rasterizer renders the page multiple time (perhaps in order to save memory and produce horizontal strips). On the first rendering the cache is filled and reused on the subsequent renderings thereby improving performance even if all cached items are used only once.
    Based upon this theory I hoped that the strip height would grow if I added more memory to the printer but this was not the case on the two printers for which I had memory to test with. Even substantial changes to the available memory (e.g. going from 32 MB to 96 MB) had no impact whatsoever on the performance.
    Summary
    The issue is not related to the file size as the original requester suspected but very likely due to the uncached rendering. Caching of glyphs can be achieved by using the "ucache" instruction or perhaps by placing the glyphs in font dictionaries and using the "show" operator.
    Although reported in 2003, time is apparently not healing this quick enough since printers in the 10,000$ class like the Sharp MX2310U still take a full minute to print 10 pages and a desktop printer may be blocked for over an hour for the same document.
    We will now try to use the CUPS filter and leave the printers configured as Postscript printers. If there is interest I can post the single file source of a CUPS filter that performs the inline conversion described. Apart from libl it requires no additional libraries and written using flex it is reasonably lightweight and fast.
    I would appreciate any opinion on whether or not the proposed workaround for bug 8023990 (https://bugs.openjdk.java.net/browse/JDK-8023990), namely having the system property "sun.awt.fontconfig" pointing to a working fontconfig.properties of a previously installed and working 1.6 version file, is safe.
    Measures (Appendix)
    "Terms and Conditions" report
    Testing a single page "Terms and Conditions" report in "Arial" 8pt (I am aware that "Helvetica" is width compatible and nearly looks the same but in this particular case the line height was also relevant and as explained above, printer fonts are currently not working). The page contains 17000 characters of which some parts are bold and some italic. This is a real world example and to make things worse the requirement is to print the text on the backside of every page on a certain class of reports. I am aware that this is a bit extreme but I also felt that I couldn't dismiss it as being unreasonable.
    File "Arial.ps" (7.5 MB Unmodified output of the JVM)
    Printer
    Printing time
    Dell 2330dn 32MB/96MB
    3:50 minutes
    Lexmark X658de (55 ppm, aprox. 5,000$)
      1:45 minutes
    HP LaserJet 4240n 64 MB
    1:12 minutes
    Kyocera Taskalfa 300ci (30 PPM, aprox. 8,000$)
    1 minute
    HP Color LaserJet 4650 dn 128/384MB
    51 seconds
    Sharp MX 2310U 512MB (55ppm,  aprox. 10,000$)
    31 seconds
    Arial_inline.ps (8 MB contains "ucache" without normalization and without dictionary)
    Printer
    Printing time
    32MB/96MB
    30seconds/30seconds (Improvement by factor 7.7)
    Lexmark X658de (55 ppm, aprox. 5,000$)
      15 seconds (Improvement by factor 7)
    HP LaserJet 4240n 64 MB
    47 seconds (Improvement by factor 1.5)
    Kyocera Taskalfa 300ci (30 PPM, aprox. 8,000$)
    20 seconds (Improvement by factor 5)
    HP Color LaserJet 4650 dn 128/384MB
    46 seconds (Improvement by factor 1.1)
    Sharp MX 2310U 512MB (55ppm,  aprox. 10,000$)
    14 seconds (Improvement by factor 2)
    Asian characters test
    Testing 10 pages of Asian characters in the font "WenQuanYi Zen Hei" 12pt where each page contains 49 lines by 40 unique characters. The document contains the 30,000 characters between unicode 0x4e00 and 0x9fff. This is a nonsense stress test but it illustrates  that the "ucache" speedup works even though no character is repeated in the report.
    Asian.ps  (52 MB Unmodified output of the JVM)
    Printer
    Printing time
    Dell 2330dn 32MB/96MB
    64 minutes
    Lexmark X658de (55 ppm, aprox. 5,000$)
    Not measured
    HP LaserJet 4240n 64 MB
    11 minutes
    Kyocera Taskalfa 300ci (30 PPM, aprox. 8,000$)
    Not measured
    HP Color LaserJet 4650 dn 128/384MB
    9:13 minutes
    Sharp MX 2310U 512MB (55ppm,  aprox. 10,000$)
    4:08 minutes
    Asian_inline.ps (54 MB contains "ucache" without normalization and without dictionary)
    Printer
    Printing time
    32MB/96MB
    5:30 minutes (Improvement by factor 11.6)
    Lexmark X658de (55 ppm, aprox. 5,000$)
    Not measured
    HP LaserJet 4240n 64 MB
    3:48 minutes (Improvement by factor 2.9)
    Kyocera Taskalfa 300ci (30 PPM, aprox. 8,000$)
    Not measured
    HP Color LaserJet 4650 dn 128/384MB
    2:46 minutes (Improvement by factor 3.4)
    Sharp MX 2310U 512MB (55ppm,  aprox. 10,000$)
    48 seconds (Improvement by factor 5)

    Hi Sven,
    Will putting the boilerplate in the trailer section allow me to still have it appearing on the back page of the main report? This is where it needs to be as far as the printed report goes - it is duplexed.
    Regards
    Lanny

  • What's in the JVM Process's Memory Space?

    Hello
    I'm noticing the following behavior on an NT system. On
    application startup, I see
    Total Heap 9 MB
    Used Heap 5.5 MB
    java.exe memory (from NT Task Manager) 36 MB
    After a "login" operation which loads a few more
    classes:
    Total Heap 12.5 MB
    Used Heap 8.2 MB
    java.exe memory (from NT Task Manager) 53 MB
    Heap memory leaks have been ruthlessly suppressed
    (thanks to OptimizeIt and careful programming). The
    behavior I do not understand is that the NT process
    (java.exe) increased in size by 17 MB when the Java
    heap increased by only 3 MB. The .jar file in which the
    application resides is less than 1 MB, so this 14 MB
    growth can not be attributed to new classes being
    loaded.
    Does anyone know what is going into the process
    memory space of java.exe? It tends to grow larger
    and larger.
    Should I even care? Do I want a large allocation of
    process memory for java.exe, or will that hamper
    performance of machines with less physical memory?
    Posts on related topics in this forum have sometimes
    advocated allocating a lot of memory to the JVM with
    -X options.
    Thanks

    Hello
    I am facing exactly the same problem on NT. However, on 2000 Server this problem doesn't seem to exist. Are you, by any chance, using JNI? We are extensively using JNI in our Servlets and found that there is definitely some momory leak there. We could not figure out any substantial leak at Java end. In NT's "Task Manager" java.exe is always listed first and very rarely the memory usage seems to come down. On 2000 Server the performance is far better.
    Please visit this link:
    http://forum.java.sun.com/thread.jsp?forum=33&thread=211330
    Regards
    Manish Bhatnagar

Maybe you are looking for