Memory Leak in Swing.

Hi!
I have Real time application(JDK1.3). After each 30 sec it brings data from backend &puts into JTable.
But it works only for 6 to 8 hours. After that it gives error
in JVM.dll.
I'm using 3 threads. Main code is something like this.
public class Main extends Thread{
public void run(){
while(true)
try{
Testtable.Update();
Thread.sleep(30000);
}catch(InterruptedException e)
{ System.out.println("error occured");}
TestTable is a public class which extends AbstractTableModel. This is a inner class of Main class.
I have checked memory usage of java.exe. It increases
usage after sometime.
How to detect memory leak? Do have to do changes in my code? "vector" usage is more in this program.
Thanks,
Sujata.

Hi,
For cellrendering I have following code.
public class MultiLineHeaderRenderer extends JList implements TableCellRenderer{
public MultiLineHeaderRenderer() {
try{
setOpaque(true);
setForeground(UIManager.getColor("TableHeader.foreground"));
setBackground(UIManager.getColor("TableHeader.background"));
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
ListCellRenderer renderer = getCellRenderer();
((JLabel)renderer).setHorizontalAlignment(JLabel.CENTER);
setCellRenderer(renderer);
}catch ( Exception err){
TeCILog.logTrace( this, "Failed to construct MultiLineHeaderRenderer." );
TeCILog.logError( this, err );
public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected, boolean hasFocus, int row, int column)
setFont(table.getFont());
String str = (value == null) ? "" : value.toString();
BufferedReader br = new BufferedReader(new StringReader(str));
String line;
Vector v = new Vector();
try {
while ((line = br.readLine()) != null)
v.addElement(line);
br.close();
}catch (IOException ex) {
ex.printStackTrace();
} catch(Exception err){
System.out.println("error" + err );
setListData(v);
return this;
private ListCellRenderer renderer = null;
Does this is causing leakage?
Sujata

Similar Messages

  • Memory leak with Swing application

    My application uses more and more memory as I use it. However, if it is working like I think, it is not creating more objects and has no reason to use more memory. When the application is minimized a lot of that memory is freed up. Does anyone know what is the cause of this? I have a sneaking suspicion that it is somehow related to my swingworkers. Also, if it is an error with my code how do I use the netbeans profiler to find the cause? I have just used the profiler for the first time - all I really can tell is that it seems to consume more and more memory.

    To answer a comment earlier in this thread, of course
    the jvm is doing garbage collection - that's the way
    java works. Nobody said otherwise. What was said was that the JVM doesn't necessarily release the memory. Just because the object has been collected doesn't mean the JVM is going to give it back to the OS.
    As I understand, when you do System.gc()
    this is apparently just a hint to the jvm to do
    garbage collection. To quote the api:
    "Calling the gc method suggests that the Java
    Virtual Machine expend effort toward recycling
    unused objects in order to make the memory they
    currently occupy available for quick reuse."Which is irrelevant. Furthermore, this thread is almost a year old.

  • Memory leak with 1.6.0_07 in applet using Swing

    Java Plug-in 1.6.0_07
    Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
    Windows XP - SP2
    I have a commercial application that has developed a memory leak with the introduction of the latest plugin. The applets chew up memory and eventually freeze. They did not before. Using jvisualm I see a build up of native arrays, primarily int[][] and char[]. I'm still investigating. Anyone have a similar experience?
    The Applet uses a swing interface, uses buffered images and swing timers, and regularly performs http connections to the server which result in actions via the SwingUtil.invokeLater() method.

    I am Using Internet Explorer Browser Version 6.0.Huge security hole.
    Its not throwing Error / Exception Wrap a try/catch at the highest level possible.
    Catch 'Throwable'. And log/display it somewhere.

  • Memory Leak Java Plugin with Swing Applet

    Hi
    I experience the following problem and desperately need help on this. The Java Plugin (I use Version 1.3.1_02) seems to have a problem in printing Swing Applets.
    The problem can easily be reproduced (at least with NT):
    1) Start Internet Explorer or Netscape (I used 5.5/4.07)
    2) Launch the following demo swing applet
    http://java.sun.com/products/plugin/1.3.1_01a/demos/jfc/SwingSet2/SwingSet2Plugin.html
    3) Print the applet and observe (using task manager) the memory used by the browser process (the memory used by the process will increase every time you hit the print button but never decrease unless you shut down the browser)
    4) Print a couple of times (you may want to pause your print queue) and you will be able to crash your computer
    This seems to be the same bug reported with 4638742. However it says "in progress" for quite some time and I was wondering if some genious might know a work around for this.
    Cheers

    You might want to read an article about memory leaks in Java:
    http://www-106.ibm.com/developerworks/library/j-leaks/

  • Memory leak in JSpinner implementation (maybe others?)

    Hi,
    I am developing an application using Java and Swing, and have run into some problems with memory leaks. After examining the source code and making an example program (provided below), I can only come to the conclusion that there is a bug in the implementation of JSpinner in Sun Java 1.6.0_03.
    If one uses a custom model with the JSpinner, it attaches itself as a listener to the model. However, it never removes the listening connection, even if the model is changed. This causes the JSpinner to be kept in memory as long as the model exists, even if all other references to the component have been removed.
    An example program is available at http://eddie.dy.fi/~sampo/ModelTest.java . It is a simple swing program that has the JSpinner and two buttons, the first of which writes to stdout the listeners of the original model and the second changes the spinner model to a newly-created model. A sample output is below:
    Running on 1.6.0_03 from Sun Microsystems Inc.
    Listeners before connecting to JSpinner:
      Model value is 0, 0 listeners connected:
    Listeners after connecting to JSpinner:
      Model value is 0, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Changing spinner model.
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971adThis shows that even though the model of the JSpinner has been changed, it still listens to the original model. I haven't looked at other components whether they retain connections to the old models as well.
    In my case, I have an adaptor-model which provides a SpinnerModel interface to the actual data. The adaptor is implemented so that it listens to the underlying model only when it itself is being listened to. If the JComponents using the model were to remove the listening connections, it, too, would be automatically garbage-collected. However, since JSpinner does not remove the connections, the adaptor also continues to listen to the underlying model, and neither can be garbage-collected.
    All in all, the listener-connections seem to be a very easy place to make memory leaks in Java and especially in Swing. However, as I see it, it would be a simple matter to make everything work automatically with one simple rule: Listen to the models only when necessary.
    If a component is hidden (or alternatively has no contact to a parent JFrame or equivalent), it does not need to listen to the model and should remove the connections. When the component is again set visible (or connected to a frame) it can re-add the connections and re-read the current model values just as it does when initializing the component. Similarly, any adaptor-models should listen to the underlying model only when it itself is being listened to.
    If the components were implemented in this way, one could simply remove a component from the frame and throw it away, and automatically any listener-connections will be removed and it can be garbage-collected. Similarly any adaptor-models are collected when they are no longer in use.
    Changing the API implementation in this way would not require any changes to applications, as the only thing that changes are the listener-connections. Currently used separate connection-removing methods should still work, though they would be unnecessary any more. The API would look exactly the same from the view of an application programmer, only that she would not need to care about remnant listening connections. (As far as I can tell, the current API specification would allow the API to be implemented as described above, but it should of course require it to be implemented in such a way.)
    Am I missing something, or is there some valid reason why the API is not implemented like this?
    PS. I'm new to these forums, so if there is a better place to post these reports, please tell me. Thanks.

    Another cognition: It's the following code, that causes the memory to be accumulated:
    obj = m_orb.resolve_initial_references("NameService");
    ctx = NamingContextExtHelper.narrow(obj);For the first 4 calls to this code the memory usage of the nameservice is unchanged. From the 5th to the 8th call, it's increased by approx. 10KB per call. And thenceforward (beginning with the 9th call) it's increasing by approx. 10MB.
    What's going wrong here?

  • Memory leak in Tomcat 5.5

    Hi all, i am experiencing memory leaks while using tomcat 5.5 and mysql connector 3.1.7.. While running the attached code tomcat swallows up to 20 mb and doesnt return it. I close down everything but the app still leaks mem. For now it's not an issue (Tomcat stays below 60mb mem of 1gb), however running this app on serveral clients will dramatically increase the memory allocation.
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.awt.Image;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    public class Thumbs extends HttpServlet {
      private String dbDriver = "com.mysql.jdbc.Driver";
      private String dbURL = "jdbc:mysql://localhost/webapp?";
      private String userID = "javauser";
      private String passwd = "javadude";
      private Connection dbConnection;
      //Initialize global variables
      public void init() throws ServletException {
      //Process the HTTP Get request
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try{
           String maxDim = "";
           String siteString = request.getParameterValues("s")[0];
           if (request.getParameterValues("d") != null){
               maxDim = request.getParameterValues("d")[0];
           if (maxDim == ""){
               response.setContentType("image/jpeg");
               OutputStream out = response.getOutputStream();
               writePicture(out,siteString);
           else{
               if (siteString != null) {
                   int maxDimension = Integer.parseInt(maxDim);
                   response.setContentType("image/jpeg");
                   OutputStream out = response.getOutputStream();
                   writeThumbnailPicture(out, siteString, maxDimension);
        } catch (Exception ex){
            ex.printStackTrace();
            log(ex.getMessage());
      public void writePicture(OutputStream out, String siteID){
          try{
              Class.forName(dbDriver);
              dbConnection = DriverManager.getConnection(dbURL, userID, passwd);
              PreparedStatement stmt = dbConnection.prepareStatement("select * from webcatalog where ID = ?");
              stmt.setString(1,siteID);
              stmt.executeQuery();
              ResultSet rs = stmt.getResultSet();
              if (rs.next()) {
                  byte[] data = rs.getBytes("Picture");
                  if (data != null) {
                      Image inImage = new ImageIcon(data).getImage();
                      BufferedImage outImage = new BufferedImage(inImage.getWidth(null),
                                                                 inImage.getHeight(null),
                                                                 BufferedImage.TYPE_INT_RGB);
                      // Paint image.
                      Graphics2D g2d = outImage.createGraphics();
                      g2d.drawImage(inImage,null,null);
                      // JPEG-encode the image
                      JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                      encoder.encode(outImage);
                      out.close();
              rs.close();
              stmt.close();
              dbConnection.close();
          }catch(Exception ex){
              ex.printStackTrace();
      public void writeThumbnailPicture(OutputStream out,String siteID,int maxDimension){
        try{
          Class.forName(dbDriver);
          dbConnection = DriverManager.getConnection(dbURL, userID, passwd);
          PreparedStatement stmt = dbConnection.prepareStatement("select * from webcatalog where ID = ?");
          stmt.setString(1,siteID);
          stmt.executeQuery();
          ResultSet rs = stmt.getResultSet();
          if (rs.next()) {
            byte[] data = rs.getBytes("Picture");
            if (data != null) {
              Image inImage = new ImageIcon(data).getImage();
              // Determine the scale.
               double scale = (double)maxDimension / (double)inImage.getHeight(null);
               if (inImage.getWidth(null) > inImage.getHeight(null)) {
                   scale = (double)maxDimension /(double)inImage.getWidth(null);
               // Determine size of new image.
               // One of them should equal maxDim.
               int scaledW = (int)(scale*inImage.getWidth(null));
               int scaledH = (int)(scale*inImage.getHeight(null));
               // Create an image buffer in
               //which to paint on.
               BufferedImage outImage = new BufferedImage(scaledW, scaledH,
                   BufferedImage.TYPE_INT_RGB);
               // Set the scale.
               AffineTransform tx = new AffineTransform();
               // If the image is smaller than
               // the desired image size,
               // don't bother scaling.
               if (scale < 1.0d) {
                   tx.scale(scale, scale);
               // Paint image.
               Graphics2D g2d = outImage.createGraphics();
               g2d.drawImage(inImage, tx, null);
               g2d.dispose();
               // JPEG-encode the image
               JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
               encoder.encode(outImage);
               out.close();
          rs.close();
          stmt.close();
          dbConnection.close();
        catch(Exception ex){
          ex.printStackTrace();
      //Clean up resources
      public void destroy() {
      private void jbInit() throws Exception {
    }

    you can try this:
    open your connection outside the function, and then pass it like as a parameter...
    writePicture(OutputStream out, String siteID, Connection conn)
    this can solve the problem because opening the connection inside the function spends a lot of memory...
    Hope this can help you
    Regards
    Fernando

  • Memory Leak with new Font()

    Hello all,
    Not sure if this is the right place to post this but here goes. I have a program that needs to change the font of at least 250,000 letters, however after doing this the program runs slow and laggy as if changing the fonts of each letter took up memory and never released it? Here is a compilable example, Click the button at the bottom of the window and watch the letter it is currently working on. You will notice that around 200,000 it will begin to not smoothly count up anymore but count in kind of a skipping pattern. This seems to get worse the more you do it and seems to indicate to me that something is using memory and not releasing it. I'm not sure why replacing a letter's font with a new font would cause more memory to be taken up I would think if I was doing it properly it would simply replace the old font with the new one not taking anymore memory then it did before. Here is the example: This program sometimes locks up so be prepared. If someone could maybe point out what is causing this to take up more memory after changing the fonts that would be great and hopefully find a solution :) Thanks in advance.
    -neptune692
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package paintsurface;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.util.List;
    public class PaintSurface implements Runnable, ActionListener {
    public static void main(String[] args) {
            SwingUtilities.invokeLater(new PaintSurface());
    List<StringState> states = new ArrayList<StringState>();
    Tableaux tableaux;
    Random random = new Random();
    Font font = new Font("Arial",Font.PLAIN,15);
    //        Point mouselocation = new Point(0,0);
    static final int WIDTH = 1000;
    static final int HEIGHT = 1000;
    JFrame frame = new JFrame();
    JButton add;
    public void run() {
            tableaux = new Tableaux();
            for (int i=250000; --i>=0;)
                    addRandom();
            frame.add(tableaux, BorderLayout.CENTER);
            add = new JButton("Change Font of letters - memory leak?");
            add.addActionListener(this);
            frame.add(add, BorderLayout.SOUTH);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(WIDTH, HEIGHT);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    public void actionPerformed(ActionEvent e) {
        new Thread(new ChangeFonts()).start();
    void addRandom() {
            tableaux.add(
                            Character.toString((char)('a'+random.nextInt(26))),
                            UIManager.getFont("Button.font"),
                            random.nextInt(WIDTH), random.nextInt(HEIGHT));
    //THIS CLASS SEEMS TO HAVE SOME KIND OF MEMORY LEAK I'M NOT SURE?
    class ChangeFonts implements Runnable {
        public void run() {
        Random rand = new Random();
            for(int i = 0; i<states.size(); i++) {
                font = new Font("Arial",Font.PLAIN,rand.nextInt(50));
                states.get(i).font = font;
                add.setText("Working on letter - "+i);
    class StringState extends Rectangle {
            StringState(String str, Font font, int x, int y, int w, int h) {
                    super(x, y, w, h);
                    string = str;
                    this.font = font;
            String string;
            Font font;
    class Tableaux extends JComponent {
            Tableaux() {
                    this.enableEvents(MouseEvent.MOUSE_MOTION_EVENT_MASK);
                    lagState = createState("Lag", new Font("Arial",Font.BOLD,20), 0, 0);
            protected void processMouseMotionEvent(MouseEvent e) {
                    repaint(lagState);
                    lagState.setLocation(e.getX(), e.getY());
                    repaint(lagState);
                    super.processMouseMotionEvent(e);
            StringState lagState;
            StringState createState(String str, Font font, int x, int y) {
                FontMetrics metrics = getFontMetrics(font);
                int w = metrics.stringWidth(str);
                int h = metrics.getHeight();
                return new StringState(str, font, x, y-metrics.getAscent(), w, h);
            public void add(String str, Font font, int x, int y) {
                    StringState state = createState(str, font, x, y);
                    states.add(state);
                    repaint(state);
            protected void paintComponent(Graphics g) {
                    Rectangle clip = g.getClipBounds();
                    FontMetrics metrics = g.getFontMetrics();
                    for (StringState state : states) {
                            if (state.intersects(clip)) {
                                    if (!state.font.equals(g.getFont())) {
                                            g.setFont(state.font);
                                            metrics = g.getFontMetrics();
                                    g.drawString(state.string, state.x, state.y+metrics.getAscent());
                    if (lagState.intersects(clip)) {
                    g.setColor(Color.red);
                    if (!lagState.font.equals(g.getFont())) {
                        g.setFont(lagState.font);
                        metrics = g.getFontMetrics();
                    g.drawString("Lag", lagState.x, lagState.y+metrics.getAscent());
    }Here is the block of code that I think is causing the problem:
    //THIS CLASS SEEMS TO HAVE SOME KIND OF MEMORY LEAK I'M NOT SURE?
    class ChangeFonts implements Runnable {
        public void run() {
        Random rand = new Random();
            for(int i = 0; i<states.size(); i++) {
                font = new Font("Arial",Font.PLAIN,rand.nextInt(50));
                states.get(i).font = font; // this line seems to cause the problem?
                add.setText("Working on letter - "+i);
    }

    neptune692 wrote:
    jverd wrote:
    You're creating a quarter million distinct Font objects, and obviously you must be hanging on to all of them because each character is having its font set to the newly created object. So if you have 250k chars, you're forcing it to have 250k Font objects.
    Since the only difference is that rand.nextInt(50) parameter, just pre-create 50 Font objects with 0..49, stick 'em in the corresponding elements in an array, and use rand.nextInt to select the Font object to use.That does make sense but it does that when the the program is first launched and doesn't lag. But the second and third time you change the letters font it seems to lag so if it wasn't taking up more memory the second time it should perform like it did when it first launched. I don't care to investigate any further. The real problem is almost certainly the quarter million Font objects. It could be that 250k is fine, but by the time you get to 500k, it has to do a lot of GC, and that's where the slow down is coming. You might even be able to make it work better with the code you have just by tweaking the GC parameters at startup, but I wouldn't bother. Fix the code first, and then see if you have issues.
    Does creating a new font for each of those letters not replace the old font object? If it didn't use more memory the second and third time I don't think you would see the skipping in the counter and the slowing down of the iterations. So it must be remembering some of the old font objects or am I wrong?Using new always creates a new object. When you do it the second time around, and call letter.setFont(newFont), the old Font object is eligible for GC. That doesn't mean it will be GCed right away though. The JVM can leave them all laying around until it runs out of memory, and then GC some or all of them.

  • Help with Java Memory Leak in URLConnection

    Hi everyone,
    I can't seem to find the memory leak in the below code, if anyone could help, i would greatly appreciate it. The jist of the code is: I open up a URLConnection to update a ColdFusion page that takes in URL parameters passed in my URL. Then, I get the response. I also check for proxy usage and take that into consideration when making the connection.
    I have one class to handle the Connections, Connect.java:
         * Connection using Username and Password, as well as boolean option to use Basic Proxy Authentication
         public Connect(String pHost, String pPort, String urlString,
                             String pUsername, String pPassword, boolean useProxy) {
              this.pHost = pHost;
              this.pPort = pPort;
              this.urlString = urlString;
              this.pUsername = pUsername;
              this.pPassword = pPassword;
              this.useProxy = useProxy;
         * Get the Input Stream from the Connection given a specific URL
         public java.io.InputStream getInputStream(String urlString) {
              if (urlString == null) urlString = this.urlString;
                 exDialog = new ExceptionDialog(new javax.swing.JFrame());
              try {
                   String auth = "";
                   if (useProxy) {
                        System.getProperties().put("proxySet", "true");
                        System.getProperties().put("proxyHost", pHost);
                        System.getProperties().put("proxyPort", pPort);
                        String authString = "";
                        if (pUsername != null && pUsername != "") authString = pUsername + ":";
                        else authString = "username:";
                        if (pPassword != null && pPassword != "") authString = authString + pPassword;
                        else authString = authString + "password";
                        auth = "Basic " + new sun.misc.BASE64Encoder().encode(authString.getBytes());
                   java.net.URL url = new java.net.URL(urlString);
                   java.net.HttpURLConnection conn = (java.net.HttpURLConnection)url.openConnection();
                   if (useProxy) conn.setRequestProperty("Proxy-Authorization", auth);
                   conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)");
                   conn.setDoInput( true );
                   conn.setDoOutput( true );
                   conn.connect();
                   return conn.getInputStream();
              } catch (java.io.IOException ioe) {
                   exDialog.showForThrowable(ioe.toString(),ioe);
                   return null;
         }I call the code in Download.java:
    Connect conn = new Connect(sm.pHost, sm.pPort, null, sm.pUser, sm.pPass, sm.useProxy);
    new BufferedReader(new InputStreamReader(conn.getInputStream(sUpdateURL)));
    in.close();For some reason, as I loop through this call, the memory footprint of my program grows through every iteration, eventually resulting in a Java Out of Memory error. I can't track the leak down and it's fairly frustrating. If anyone can help, that would be greatly appreciated. Thanks!

    One place there might be a memory leak is in the line
    exDialog = new ExceptionDialog(new javax.swing.JFrame());Even though the JFrame object goes out of scope when the ExceptionDialog method returns, JFrames stay around until they are closed, even though in this case it isn't even shown on the screen.

  • Memory Leak with JPopupMenu

    It seems there is a memory leak with JPopupMenu. The following program demonstrates this leak. If you run the program, click on show form, and then close the form, the used memory will be GCd appropriately. If you click on show form, then right click on the table to show the popup (even if you dont do anything else with the popup) then close the form, it never GCs the form. I've tried all kinds of crazy things, but I cant seem to find what is keeping the memory from being GCd.
    Peter
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowListener;
    import java.beans.PropertyChangeListener;
    import java.text.DecimalFormat;
    import java.util.Timer;
    import java.util.TimerTask;
    import java.util.Vector;
    import javax.swing.AbstractAction;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JPopupMenu;
    import javax.swing.JRadioButtonMenuItem;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    import javax.swing.table.AbstractTableModel;
    @SuppressWarnings("serial")
    public class TriState extends JPanel {
         private static final long               K               = 1024;
         private static final long               M               = K * K;
         private static final long               G               = M * K;
         private static final long               T               = G * K;
         protected static int ctr = 1;
         private JButton                              btnShow          = new JButton("Show Form");
         private JLabel                              lblMem          = new JLabel();
         private static final DecimalFormat     df               = new DecimalFormat("#,##0.#");
         protected Timer                              updateTimer     = new Timer();
         public TriState() {
              this.setLayout(new GridLayout());
              add(btnShow);
              add(lblMem);
              updateTimer.scheduleAtFixedRate(new UpdateTimerTask(), 1000, 1000);
              btnShow.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        FrmReferrals fr = new FrmReferrals();
                        fr.setVisible(true);
         class UpdateTimerTask extends TimerTask {
              public void run() {
                   SwingUtilities.invokeLater(new Runnable() {
                        @Override
                        public void run() {
                             dumpMemoryUsage();
         protected void dumpMemoryUsage() {
              System.gc();
              Long t = Runtime.getRuntime().totalMemory();
              long f = Runtime.getRuntime().freeMemory();
              String st = convertToStringRepresentation(t);
              String sf = convertToStringRepresentation(f);
              String su = convertToStringRepresentation(t - f);
              System.out.println("Total:" + st + "(" + t + ") Free:" + sf + "(" + f + ") Used:" + su + "(" + (t - f) + ")");
              lblMem.setText(su + "/" + st);
         public static String convertToStringRepresentation(final long value) {
              final long[] dividers = new long[]{T, G, M, K, 1};
              final String[] units = new String[]{"TB", "GB", "MB", "KB", "B"};
              if (value < 1)
                   throw new IllegalArgumentException("Invalid file size: " + value);
              String result = null;
              for (int i = 0; i < dividers.length; i++) {
                   final long divider = dividers;
                   if (value >= divider) {
                        final double dr = divider > 1 ? (double) value / (double) divider : (double) value;
                        result = df.format(dr) + units[i];
                        break;
              return result;
         private static void createAndShowGUI() {
              JFrame frame = new JFrame("SimpleTableDemo");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              // Create and set up the content pane.
              TriState newContentPane = new TriState();
              newContentPane.setOpaque(true); // content panes must be opaque
              frame.setContentPane(newContentPane);
              // Display the window.
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        createAndShowGUI();
         protected class PopupMenu extends JPopupMenu {
              public PopupMenu() {
                   JRadioButtonMenuItem item1 = new JRadioButtonMenuItem(new AbstractAction("Insert Item") {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                             System.out.println(e.getActionCommand());
                   item1.setActionCommand("Insert");
                   add(item1);
                   JRadioButtonMenuItem item2 = new JRadioButtonMenuItem(new AbstractAction("Delete Item") {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                             System.out.println(e.getActionCommand());
                   item2.setActionCommand("Delete");
                   add(item2);
         public class FrmReferrals extends JFrame {
              public FrmReferrals() {
                   super();
                   init();
              protected void init() {
                   jbInit();
              protected void closeIt() {
                   uninit();
              // variables here
              protected Dimension          dimPreferred     = new Dimension(1270, 995);
              protected JTabbedPane     tabbedPane          = new JTabbedPane();
              protected JTable          tblReferrals     = null;
              protected PopupMenu          popMenu           = new PopupMenu();
              protected void jbInit() {
                   setPreferredSize(dimPreferred);
                   setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                   setTitle("Referrals");
                   JPanel pnl = new JPanel();
                   pnl.setOpaque(false);
                   pnl.setLayout(new BorderLayout());
                   pnl.add(tabbedPane, BorderLayout.CENTER);
                   // put it all in the frame
                   add(pnl);
                   pack();
                   setLocationRelativeTo(null);
                   // init the table and model
                   ReferralsTableModel ctm = new ReferralsTableModel(buildDummyVector());
                   tblReferrals = new JTable(ctm);
                   tblReferrals.setComponentPopupMenu(popMenu);
                   tblReferrals.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                   tabbedPane.add(new JScrollPane(tblReferrals, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
                   addWindowListener(new WindowListener() {
                        @Override
                        public void windowActivated(WindowEvent e) {}
                        @Override
                        public void windowClosed(WindowEvent e) {}
                        @Override
                        public void windowClosing(WindowEvent e) {
                             closeIt();
                        @Override
                        public void windowDeactivated(WindowEvent e) {}
                        @Override
                        public void windowDeiconified(WindowEvent e) {}
                        @Override
                        public void windowIconified(WindowEvent e) {}
                        @Override
                        public void windowOpened(WindowEvent e) {}
              protected Vector<DBO_Referrals> buildDummyVector() {
                   Vector<DBO_Referrals> vr = new Vector<DBO_Referrals>();
                   for (int x = 0; x < 5000; x++) {
                        DBO_Referrals r = new DBO_Referrals(x+(5000*ctr));
                        vr.add(r);
                   return vr;
              protected void uninit() {
                   tblReferrals.setComponentPopupMenu(null);
                   for (Component c : popMenu.getComponents()) {
                        PropertyChangeListener[] pl = c.getPropertyChangeListeners();
                        for (PropertyChangeListener l : pl)
                             c.removePropertyChangeListener(l);
                        if (c instanceof JMenuItem) {
                             ActionListener [] al = ((JMenuItem)c).getActionListeners();
                             for (ActionListener l : al) {
                                  ((JMenuItem)c).removeActionListener(l);
                   popMenu = null;
              protected class DBO_Referrals {
                   protected long          id;
                   protected String     Employee;
                   protected String     Rep;
                   protected String     Asst;
                   protected String     Client;
                   protected String     Dates;
                   protected String     Status;
                   protected String     Home;
                   public DBO_Referrals(long id) {
                        this.id = id;
                        Employee = "Employee" + id;
                        Rep = "Rep" + id;
                        Asst = "Asst" + id;
                        Client = "Client" + id;
                        Dates = "Dates" + id;
                        Status = "Status" + id;
                        Home = "Home" + id;
                   public long getId() {
                        return id;
                   public String getEmployee() {
                        return Employee;
                   public String getRep() {
                        return Rep;
                   public String getAsst() {
                        return Asst;
                   public String getClient() {
                        return Client;
                   public String getDates() {
                        return Dates;
                   public String getStatus() {
                        return Status;
                   public String getHome() {
                        return Home;
              public class ReferralsTableModel extends AbstractTableModel {
                   protected Vector<DBO_Referrals>          data          = new Vector<DBO_Referrals>();
                   protected String[]                         sColumns     = {"id", "Employee", "Rep", "Assistant", "Client", "Date", "Status", "Home", "R"};
                   public ReferralsTableModel() {
                        super();
                   public ReferralsTableModel(Vector<DBO_Referrals> data) {
                        this();
                        this.data = data;
                   @SuppressWarnings("unchecked")
                   @Override
                   public Class getColumnClass(int col) {
                        switch (col) {
                             case 0 :
                                  return Long.class;
                             default :
                                  return String.class;
                   @Override
                   public int getColumnCount() {
                        return sColumns.length;
                   @Override
                   public int getRowCount() {
                        return data.size();
                   @Override
                   public Object getValueAt(int row, int col) {
                        if (row > data.size())
                             return null;
                        DBO_Referrals a = data.get(row);
                        switch (col) {
                             case 0 :
                                  return a.getId();
                             case 1 :
                                  return a.getEmployee();
                             case 2 :
                                  return a.getRep();
                             case 3 :
                                  return a.getAsst();
                             case 4 :
                                  return a.getClient();
                             case 5 :
                                  return a.getDates();
                             case 6 :
                                  return a.getStatus();
                             case 7 :
                                  return a.getHome();
                             case 8 :
                                  return "+";
                             default :
                                  return null;

    BTW instead of continually printing out the memory use a profiler (jvisualvm in the jdk/bin directory -> heapdump -> search on your class -> view in instances -> find nearest GC root).
    Looks like BasicPopupMenuUI doesn't remove a reference to the JRootPane immediately. As far as I can see it will be removed when another menu shows.
    As a hackish workaround you can try this in you FrmReferrals#uninit():
                for(ChangeListener listener : MenuSelectionManager.defaultManager().getChangeListeners()) {
                    if (listener.getClass().getName().contains("MenuKeyboardHelper")) {
                        try {
                            Field field = listener.getClass().getDeclaredField("menuInputMap");
                            field.setAccessible(true);
                            field.set(listener, null);
                        } catch (Exception e) {
                            // ignored
                        break;
                }Funnily enough though it isn't there when I reduce your code to a SSCCE:
    import java.awt.*;
    import javax.swing.*;
    public class TestBasicPopupMenuUILeak extends JFrame {
        public TestBasicPopupMenuUILeak() {
            super("Not collected right away");
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(
                            new JButton(new AbstractAction("Show frame") {
                                @Override
                                public void actionPerformed(ActionEvent e) {
                                    EventQueue.invokeLater(new Runnable() {
                                        public void run() {
                                            JLabel label = new JLabel(
    "Right click to show popup, then close this frame."
    + "The frame with not be GCed until another (popup) menu is shown.");
                                            JPopupMenu popup = new JPopupMenu(
                                                    "Popup");
                                            popup.add("Item");
                                            label.setComponentPopupMenu(popup);
                                            // named differently so you can find it
                                            // easily in your favorite profiler
                                            JFrame frame = new TestBasicPopupMenuUILeak();
                                            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                                            frame.getContentPane().add(label);
                                            frame.pack();
                                            frame.setLocationRelativeTo(null);
                                            frame.setVisible(true);
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
    }

  • Memory leak in Jeditorpane.setText method while displaying html content

    I tried to display a larger size html page using JeditorPane. But I found that there as a huge memory leak after JEditorPane's setText method was called.
    Refering to the below code there was a difference of about 40 MB after the setText method was called.This does not happen if we display the page in rtf format.This finally results in Out Of memry error.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    import java.awt.BorderLayout;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.IOException;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    public class SampleProgram extends JFrame{
    public JEditorPane pane;
    static public String getContents(File aFile) {
    StringBuffer contents = new StringBuffer();
    try {
    BufferedReader input = new BufferedReader(new FileReader(aFile));
    try {
    String line = null;
    while (( line = input.readLine()) != null){
    contents.append(line);
    contents.append(System.getProperty("line.separator"));
    finally {
    input.close();
    catch (IOException ex){
    ex.printStackTrace();
    return contents.toString();
    public SampleProgram() {
    pane = new JEditorPane();
    pane.setContentType("text/html");
    pane.setEditable(false);
    pane.setCaretPosition(0);
    pane.setAutoscrolls(true);
    getContentPane().add(pane, BorderLayout.CENTER);
    setSize(400,400);
    File file = new File("D:/Audit_Log.html");
    String summary = getContents(file);
    System.out.println("Memory used Before setText invoke ==>" +((Runtime.getRuntime().totalMemory()- Runtime.getRuntime().freeMemory())/1000000)+"M");
    pane.setText(summary);
    System.out.println("Memory used after setText invoke ==>" +((Runtime.getRuntime().totalMemory()- Runtime.getRuntime().freeMemory())/1000000)+"M");
    setVisible(true);
    * @param args
    public static void main(String[] args) {
    new SampleProgram () ;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The html i am trying to display is similar to the one below.But the original content almost 10 times bigger than this html content and it has only td and tr tags. and for this file the leak is about 4 MB and if I use the file 10 times bigger than this it is 40M .
    Any suggestions how to avoid this memory leak?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <html>
    <body>
    <h1 align="center">Test HTML</h1>
    <table align="center" border="0" width="90%">
    <tr>
    <td>
    <h3>10-Sep-2008 08:11:32 GMT - <i>User</i>
    </h3>
    <h4>Employee 1 - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 2 - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 3, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 4, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 5, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 6, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 7, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 8, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 9, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 10, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 11, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 12, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 13, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 14, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 15, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 16, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 17, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 18, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 19, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 20, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 21, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 22, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 23, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 24, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 25, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 26, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 27, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 28, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 29, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 30, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 31, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 32, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 33, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 34, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 35, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 36, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 37, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr></tr>
    <tr>
    <td>Unit </td><td></td><td>India/MT</td>
    </tr>
    <tr>
    <td>Floor</td><td></td><td>MARblE</td>
    </tr>
    <tr>
    <td>Rating</td><td></td><td>Quantity: amount = 45 uom = MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 60, Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Price</td><td></td><td>India/MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employee - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Accept the agreement</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>True</td>
    </tr>
    <tr>
    <td>Conditions</td><td></td><td>AIR</td>
    </tr>
    <tr>
    <td> Status</td><td></td><td>QUALIFIED</td>
    </tr>
    <tr>
    <td>Job Type</td><td></td><td>ddddd</td>
    </tr>
    <tr>
    <td>agreement signed</td><td></td><td>TRUE</td>
    </tr>
    <tr>
    <td>Degree</td><td></td><td>True</td>
    </tr>
    <tr>
    <td> Options</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Quality</td><td></td><td>TRUE</td>
    </tr>
    <tr>
    <td>Quantity</td><td></td><td>123</td>
    </tr>
    <tr>
    <td>Basis</td><td></td><td>TOTAL</td>
    </tr>
    <tr>
    <td>GapPresent</td><td></td><td>TRUE</td>
    </tr>
    <tr>
    <td>Unit </td><td></td><td>MT</td>
    </tr>
    <tr>
    <td>Warning</td><td></td><td>4000000</td>
    </tr>
    <tr>
    <td>Rounding </td><td></td><td>3</td>
    </tr>
    <tr>
    <td>Security</td><td></td><td>OC</td>
    </tr>
    <tr>
    <td>Number</td><td></td><td>61</td>
    </tr>
    <tr>
    <td>Employee Status</td><td></td><td>Rupee INDIA</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61 - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Alternative </td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Advantage</td><td></td><td>all</td>
    </tr>
    <tr>
    <td>Loading</td><td></td><td>all</td>
    </tr>
    <tr>
    <td>flag</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Lateral</td><td></td><td>True</td>
    </tr>
    <tr>
    <td> Mode</td><td></td><td>Null</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Chain - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Roll Number</td><td></td><td>1</td>
    </tr>
    <tr>
    <td>Section</td><td></td><td>AA</td>
    </tr>
    <tr>
    <td>Percentage</td><td></td><td>100</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employee Terms - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Date of Record</td><td></td><td>DateRange
    startDate=01-Jun-2009
    endDate=30-Jun-2009
    </td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Price</td><td></td><td>India/MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employed Term 1, Fixed Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Alternative</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Price </td><td></td><td>123</td>
    </tr>
    <tr>
    <td>Unit </td><td></td><td>India/MT</td>
    </tr>
    <tr>
    <td>Floor</td><td></td><td>MARblE</td>
    </tr>
    <tr>
    <td>Remainder</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Rating</td><td></td><td>Return: amount = 55 uom = HH</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employed Term 2, Fixed Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Price </td><td></td><td>123</td>
    </tr>
    <tr>
    <td>Unit </td><td></td><td>India/MT</td>
    </tr>
    <tr>
    <td>Floor</td><td></td><td>MARblE</td>
    </tr>
    <tr>
    <td>Rating</td><td></td><td>Quantity: amount = 45 uom = MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Demurrage - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Country</td><td></td><td>Africa</td>
    </tr>
    <tr>
    <td>Term Period</td><td></td><td>2 months</td>
    </tr>
    <tr>
    <td>Time Period</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Flag ON/OFF</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Organisation Job Settlement Term - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Indicator</td><td></td><td>aaaaa</td>
    </tr>
    <tr>
    <td>Alt Event</td><td></td><td>blSPLIT</td>
    </tr>
    <tr>
    <td>Alt Osssssssssssssst</td><td></td><td>2</td>
    </tr>
    <tr>
    <td>Calendar</td><td></td><td>NEW YORK</td>
    </tr>
    <tr>
    <td>Currency Type</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Day</td><td></td><td>aaaaa</td>
    </tr>
    <tr>
    <td>Event</td><td></td><td>bl</td>
    </tr>
    <tr>
    <td>alter ddddddddd</td><td></td><td>Asia</td>
    </t

    Screen_Name_09, You can post in the bug database.
    http://bugs.sun.com/bugdatabase/

  • Memory leak when redirecting to a remote XFree86 server

    Hi,
    I'm running a Java application, which controlls our network equipment.
    The application is written by our development team. It installs a graphical
    user frontend in order to allow interoperation with the network administrators.
    The application is run using the following environments:
    * Windows NT 4.0
    * Sun Solaris 8, local Xsun X11 server
    * Sun Solaris 8, XFree86 X11 server located on a linux host
    * Sun Solaris 8, CygWin/XFree86 X11 server running on a Windows NT host
    It turns out, that the application runs fine, if the application and the GUI either
    run both on a Windows NT host or the Sun workstation. However, if the application
    is launched on a Sun workstation and the X display is redirected to any XFree86
    X11 server, each change of the GUI focus - either forced by a mouse-click, or
    an canvas being changed by the application itsself - consumes an amount of
    3 MB of memory and never releases this again.
    So I suppose any memory leak in the Swing/X11 interface ...
    I've already searched SunSolve and installed all patches addressing memory leaks
    in Solaris 8 and Xsun ...
    Also our development team already has profiled the application using tools
    like OptimizeIt without being able to locate any memory leak.
    Has anyboday seen this before? Is there any bugfix/workaround available?
    Thx in advance,
    Jens Hamisch

    We just noticed the same problem for our Swing Applet using JDK 1.4 on Solaris 8 displayed to any remote X server running on Windows 2000 or Linux. If we let the applet run long enough (the plot in the applet updated every second), we could easily use up 500-600 Mb. Again, on the local console on Solaris or Windows 2000 the memory was stable at around 70 Mb.

  • Memory Leak in WindowsTreeUI?

    I'm hunting memory leaks in my app (of which there are alarmingly many), and have just stumbled across one which appears to be a bug in the class com.sun.java.swing.plaf.windows.WindowsTreeUI
    When the tree is populated, each treenode contains a reference to a node in our own rather large data structure.
    When we close the application-level model, we also call tree.setModel(null) and expect the tree to lose all its references. From a memory management point of view, it is important that the entire old model goes out of scope before we start loading a new one.
    If the tree is visible, everything works as expected.
    But if the tree is not visible (but still in scope) e.g. because we overlay a component in a JLayeredPanel, we get some dangling references in the (private) drawingCache member of the WindowsTreeUI class. And a single dangling reference keeps the whole caboodle in scope until something else comes along.
    I have a bad feeling I'm going to have code around painfully by substitiuting in some lite dummy model and then modifying all the event handlers that get confused as a result.
    Or does anyone have a bright idea how I can persuade the drawingCache to flush itself (presumably this only happens on windows)?
    Ian

    I also had a similar problem. My app has a number of large jtrees (200-300 nodes) with other data objects attached. I was doing a simple null of the JTree thinking that it would be GC'd. Using the NetBeans profiler I could see that it never went away. I found one location where I was temporarily hang on to node references within Swing controls. I've eliminated those. I then released the listeners I specifically assigned. There seems to be other listeners hanging on to node references. I have found little in the way of documentation or advice on how to clean these up. As a work around, when I'm done with a JTree, I traverse the nodes bottom up and remove each node from its parent (DefaultMutableTreeNode - removeNodeFromParent() ). This seems to work. The NetBeans profiler shows the vast majority of the JTree objects as GC'd. I'm sure this is not a perfect solution but it seems to be serviceable.
    I would appreciate hearing about any experiences in getting JTrees to GC.

  • Memory Leak with JDialog in Java 1.4.2_07

    Hello!
    All books I have read say to close a JDialog, it is enough to call the Method "dispose". Now I have written my first applikation an with every Dialog I open, the Software needs more RAM. With every Dialog I open, my software needs 1,5 MB RAM.
    I can`t reuse the Dialogs, because the user needs to look at view at the same time
    The Question is, how to close a JDialog correct that the GC can clean all Objects in RAM.
    Here are my Example Programm where you can view the differences. I tryed a view things out. With every Dialog the software needs xxx kb of RAM (its only a little example).
    Look at the Task Manager to look the real RAM needage.
    Thanks for Help
    Rainer
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    public class TestRAMUsage extends JFrame {
         private JPanel jContentPane = null;
         private JMenuBar jJMenuBar = null;
         private JMenu fileMenu = null;
         private JMenuItem exitMenuItem = null;
         private JButton jB_showandclose_normal = null;
         private JButton jB_showandclose_advanced = null;
          * This method initializes jB_showandclose_normal     
          * @return javax.swing.JButton     
         private JButton getJB_showandclose_normal() {
              if (jB_showandclose_normal == null) {
                   jB_showandclose_normal = new JButton();
                   jB_showandclose_normal.setBounds(new java.awt.Rectangle(43,30,214,18));
                   jB_showandclose_normal.setText("open/close Dialog normal x 50");
                   jB_showandclose_normal.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             for (int i = 0; i < 50; i++) {
                                  TestDialog td = new TestDialog();
                                  td.show();
                                  td.close_normal();
                             System.gc();
              return jB_showandclose_normal;
          * This method initializes jB_showandclose_advanced     
          * @return javax.swing.JButton     
         private JButton getJB_showandclose_advanced() {
              if (jB_showandclose_advanced == null) {
                   jB_showandclose_advanced = new JButton();
                   jB_showandclose_advanced.setBounds(new java.awt.Rectangle(16,76,260,18));
                   jB_showandclose_advanced.setText("open/close Dialog advanced x 50");
                   jB_showandclose_advanced.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             for (int i = 0; i < 50; i++) {
                                  TestDialog td = new TestDialog();
                                  td.show();
                                  td.close_advanced();
                             System.gc();
              return jB_showandclose_advanced;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              TestRAMUsage application = new TestRAMUsage();
              application.show();
          * This is the default constructor
         public TestRAMUsage() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setJMenuBar(getJJMenuBar());
              this.setSize(300, 200);
              this.setContentPane(getJContentPane());
              this.setTitle("Application");
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.add(getJB_showandclose_normal(), null);
                   jContentPane.add(getJB_showandclose_advanced(), null);
              return jContentPane;
          * This method initializes jJMenuBar     
          * @return javax.swing.JMenuBar     
         private JMenuBar getJJMenuBar() {
              if (jJMenuBar == null) {
                   jJMenuBar = new JMenuBar();
                   jJMenuBar.add(getFileMenu());
              return jJMenuBar;
          * This method initializes jMenu     
          * @return javax.swing.JMenu     
         private JMenu getFileMenu() {
              if (fileMenu == null) {
                   fileMenu = new JMenu();
                   fileMenu.setText("File");
                   fileMenu.add(getExitMenuItem());
              return fileMenu;
          * This method initializes jMenuItem     
          * @return javax.swing.JMenuItem     
         private JMenuItem getExitMenuItem() {
              if (exitMenuItem == null) {
                   exitMenuItem = new JMenuItem();
                   exitMenuItem.setText("Exit");
                   exitMenuItem.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                             System.exit(0);
              return exitMenuItem;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class TestDialog extends JDialog {
         private static final long serialVersionUID = -4326706771573368209L;
         private JPanel jContentPane = null;
         private JButton jB_drucken = null;
         private JTextField jTF_hallo = null;
         private JButton jB_close = null;
          * This is the default constructor
         public TestDialog() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(541, 255);
              this.setTitle("Speicher Dialog");
              this.setContentPane(getJContentPane());
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.add(getJB_drucken(), null);
                   jContentPane.add(getJTF_hallo(), null);
                   jContentPane.add(getJB_close(), null);
              return jContentPane;
          * This method initializes jB_drucken
          * @return javax.swing.JButton
         private JButton getJB_drucken() {
              if (jB_drucken == null) {
                   jB_drucken = new JButton();
                   jB_drucken.setBounds(new java.awt.Rectangle(45, 88, 211, 19));
                   jB_drucken.setText("Sag Hallo Welt");
              return jB_drucken;
          * This method initializes jTF_hallo
          * @return javax.swing.JTextField
         private JTextField getJTF_hallo() {
              if (jTF_hallo == null) {
                   jTF_hallo = new JTextField();
                   jTF_hallo.setBounds(new java.awt.Rectangle(269, 88, 228, 19));
              return jTF_hallo;
          * This method initializes jB_close
          * @return javax.swing.JButton
         private JButton getJB_close() {
              if (jB_close == null) {
                   jB_close = new JButton();
                   jB_close.setBounds(new java.awt.Rectangle(196, 179, 109, 22));
                   jB_close.setText("Schlie�en");
                   jB_close.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             try {
                                  // setVisible(false);
                                  dispose();
                                  removeAll();
                                  // getContentPane().removeAll();
                                  // finalize();
                             } catch (Throwable e1) {
                                  // TODO Auto-generated catch block
                                  e1.printStackTrace();
              return jB_close;
          * Dispose the Dialog
         public void close_normal() {
              dispose();
          * Set all Variables to null
          * Remove all Container
          * dispose the Dialog
          * and finalize it!
         public void close_advanced() {
              // System.out.println(this.);
              dispose();
              // show();
              jContentPane = null;
              jB_drucken = null;
              jTF_hallo = null;
              jB_close = null;
              getContentPane().removeAll();
              removeAll();
              try {
                   finalize();
              } catch (Throwable e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    } // @jve:decl-index=0:visual-constraint="10,10"

    I have use Methods in some Software Produkts. But if your Software
    use 30 MB in RAM the Runtime classes say 12 MB used. I don`t think
    that this works hereThe 12 MB is the memory used of the available 30 MB memory available. Once the VM get its memory from the OS, it does not have to return the memory back to the OS right away.
    By calling System.gc() does nt guarentee the garbage collector to be activated right away. you are just asking the garbage collector to run when it get a chance. Since the emeory is not near the max memory available...the gc is likely not going to run. Futhermore, if your application is running..the gc is likely wont run, unless memory is needed when you reach the max limit.
    because the user want to view at more than one Dialog at the same
    timeunderstandable..i just hope the 50 dialogs is just for testing the memory. i can't imagine any user would want to open 50 dialog at the same time =)
    And the other is, that the Variables in the Dialog class wouldn`t clean
    in RAM (that was the reason to set all to null!)why would it not be? When you dispose the dialog, the object will be null out..so when the garbage collector kick in, it will reclaim the memory. Now, if you have references to object in the dialog, that reference will be null out as well..the object may still exist (by having another live object having a reference to it)...the garbage collector would reclaim the dialog memory..but not the "live" object that the dialog has reference to.
    I ran the application..testing both button.
    The top button..there were little memory consumption..the second button consume a little memory bit-by-bit. I see no memory leak here. What happens is you called GC() 50 times..but it will only run one time when it get a chance...by nulling out the variables, and calling finalize()..it actually slow down the garbage collecting...that's why you should not even obther with having those two method. Furthermore, finalize method may not even be called.
    Memory leak occurs when you have a reference from an object still hanging around, but that object is no longer needed. This is a design issue.
    example
    public class A{
        Item item = new Item();
        public void getItem(){ return item; };
    public class B{
        Item item;
        public B(A a){
            item = a.getItem();
    A a = new A();
    B b = new B(a);
    a = null;when a is null out..the item reference is null, but the actual object still exist and 'b' has a reference to it. so by nulling out those object does not mean you just got rid of the object. it's better to let the object scope run out..and the garbage collector to collect it.. When you null out the object, you could accidentally null out an object that some other object may be using.

  • Listener memory leaks

    Just noticed these warnings in my Tomcat log files.
    Not sure if they are cause for concern or if they indicate some mis-configuration on my side. Maybe some from the Oracle APEX team can take a look at it. Thanks.
    01-Dec-2014 17:38:25.924 WARNING [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [apex] appears to have started a thread named [UCP-worker-thread-24] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
    sun.misc.Unsafe.park(Native Method)
    java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    java.lang.Thread.run(Thread.java:745)
    01-Dec-2014 17:38:25.928 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.store.CharUtil$1] (value [org.apache.xmlbeans.impl.store.CharUtil$1@7de8083f]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@4f4bdbe7]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    01-Dec-2014 17:38:25.928 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.XmlBeans$1] (value [org.apache.xmlbeans.XmlBeans$1@11a5e205]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@3faf4a40]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    01-Dec-2014 17:38:25.929 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1] (value [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1@23b147a]) and a value of type [java.util.ArrayList] (value [[java.lang.ref.SoftReference@133e6339]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    01-Dec-2014 17:38:25.929 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apex] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.store.Locale$1] (value [org.apache.xmlbeans.impl.store.Locale$1@2db50e91]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@680dac2d]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

    There was another time that I dabbled in this idea.
    But it always comes back to objects cleaning up
    after themselves. Now if its not your code and you
    cant ensure good behavior, then perhaps there is
    cause. But I'd keep an assert and report the issue
    if I saw it trigger.What would fire the assert? The Listener will never be garbage collected while it is listening to something. I assume that you are talking about when the listener is a Swing Object like a JFrame. I don't really like to use gui components as listeners.
    If you have to write a clean up method, it kind of defeats the value of having automatic garbage collection to a degree. I like to be able to let my Objects just fall out of scope or just become unreachable when they are no longer needed without having to actively manage their deallocation.

  • Memory Leak for Graphics2D.drawString?

    Hi, all!!
    I am a Java Programmer who is experienced in Swing application on a windows platform.
    I have developed a code snipplet to print out to use Graphics2D.drawString method.
    Then, I have encountered the performance degrade that the number of objects are created per call for the method.
    It seems that there is a difference among JDKs.
    When such a method is called, the number of objects are created is the followings
    Java1.4 | 138
    Java5 | 946
    Java6 | 1217
    Is this a known bug that JDK has since JDK has changed graphically from Tiger?
    or is it related to memory leak?
    Thank you in advance
    Edited by: Yuichi_Yamada on Jun 30, 2008 5:31 AM

    Yuichi_Yamada wrote:
    Is there a noticeable performance degradation in your application (from the user's perspective?)Compared to Java1.4, it takes 4 times longer to finish print-outs for large volume of data.Please post the example you're benchmarking. I wrote up a quick little micro-benchmark (I know I know, not a 100% accurate benchmark, but just as a quick test), and could not reproduce the performance degradation time-wise (I didn't test memory usage). In fact, with this benchmark, it appears that 1.6 is around 3x faster with Graphics#drawString() than 1.4:
    Printing "Hello, world!" 500,000 times (approximate average of 10 runs):
    1.4 - 5600ms
    1.5 - 2300ms
    1.6 - 1920ms
    Printing "Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!" 500,000 times) (approximate average of 10 runs):
    1.4 - 30833ms
    1.6 - 8844ms
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class DrawStringMicroBenchmark extends JFrame {
         private BufferedImage bi;
         private JTextField toPaintField;
         private SpinnerNumberModel iterModel;
         private JTextArea resultArea;
         public DrawStringMicroBenchmark() {
              bi = new BufferedImage(300,300, BufferedImage.TYPE_INT_RGB);
              JPanel cp = new JPanel(new BorderLayout());
              JPanel dataPanel = createDataPanel();
              cp.add(dataPanel, BorderLayout.NORTH);
              JPanel buttonPanel = new JPanel();
              JButton b = new JButton("Repaint");
              b.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        runTest();
              buttonPanel.add(b);
              cp.add(buttonPanel, BorderLayout.SOUTH);
              setContentPane(cp);
              setTitle("Graphics2D#drawString() Micro Benchmark");
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
         private JPanel createDataPanel() {
              JPanel dataPanel = new JPanel();
              dataPanel.setLayout(new BoxLayout(dataPanel, BoxLayout.Y_AXIS));
              dataPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
              toPaintField = new JTextField("Hello world!", 30);
              dataPanel.add(createLabeledItem("String to paint: ", toPaintField));
              JSpinner iterSpinner = createIterSpinner();
              iterModel = (SpinnerNumberModel)iterSpinner.getModel();
              dataPanel.add(createLabeledItem("Iterations: ", iterSpinner));
              resultArea = new JTextArea(5, 30);
              resultArea.setEnabled(false);
              resultArea.setEditable(false);
              dataPanel.add(createLabeledItem("Result: ", new JScrollPane(resultArea)));
              dataPanel.add(Box.createVerticalGlue());
              return dataPanel;
         private JPanel createLabeledItem(String label, JComponent item) {
              JPanel temp = new JPanel(new BorderLayout());
              temp.add(new JLabel(label), BorderLayout.LINE_START);
              temp.add(item);
              return temp;
         private JSpinner createIterSpinner() {
              SpinnerModel model = new SpinnerNumberModel(50000, 1,Integer.MAX_VALUE, 1000);
              return new JSpinner(model);
         private void runTest() {
              String text = toPaintField.getText();
              int iter = ((Integer)iterModel.getValue()).intValue();
              Graphics2D g2d = bi.createGraphics();
              long start = System.currentTimeMillis();
              for (int i=0; i<iter; i++) {
                   g2d.drawString(text, 30, 30);
              long time = System.currentTimeMillis() - start;
              resultArea.append(iter+ " iterations: " + time + " ms\n");
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        new DrawStringMicroBenchmark().setVisible(true);
    }

Maybe you are looking for

  • How to connect Apple TV to wi-Fi at a Marriott hotel

    Traveling with my new Apple TV, the setup process hangs up on "acquiring the time and date" when attempting to tie it in to the Marriott Hotel's AT&T wi-Fi network. It appears to get an IP address, but when logging in with my iPhone there's always a

  • How can I re-download a digital booklet?

    I know we have the beta of iCloud but they don't list digital booklets for download. I have a booklet that seems to be corrupt and would like to re-download it. Any easy way to do this with out contacting customer service? Thanks!

  • Low frequency Voltage measurement

    Hi, I am using PCI 6025E to control load bank and to measure voltage, current and frequency of a generator. While current and frequency measurement  is not a problem, voltage measurement is toublesome. Since on test bench already there are few PCI bo

  • My eMac has USB 1.1 only am I screwed?

    Hello, I just received my ipod Touch and my eMac only has a USB1.1 port. Am I screwed? Is my new iTouch useless now? I tried to connect it to iTunes 8 and got this message. Itunes could not connect to the ipod because an unkown error occured OX E8000

  • No Transfer Rule(s) available for the transfer structure 0FI_AR_4_DB in the

    Hi friends   when i have trying to transport infocube 0fiar_c03 with infosource 0fi_ar_4 from development client.the following message has shown as error "No Transfer Rule(s) available for the transfer structure 0FI_AR_4_DB in the control table".pl l