To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=90659
                 Issue #|90659
                 Summary|Disposing XTextDocument Memory Leak
               Component|Word processor
                 Version|OOo 2.4.0
                Platform|PC
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|mru
             Reported by|anestikas





------- Additional comments from [EMAIL PROTECTED] Thu Jun 12 12:28:09 +0000 
2008 -------
I have created the following example that opens a lot of empty documents and
disposes them.

The problem is that the memory size of the process soffice.bin is constantly
growing (see in task manager).

I tried using XCloseable but the results were the same.

I posted this problem in
http://www.oooforum.org/forum/viewtopic.phtml?t=72265
but nobody answered (so far) so I am posting a bug report.

import com.sun.star.beans.PropertyValue;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;

public class MemoryLeakExample {

   public static void main(String[] args) throws Exception {
      XComponentContext context = Bootstrap.bootstrap();
      XMultiComponentFactory factory = context.getServiceManager();
      Object desktop =
factory.createInstanceWithContext("com.sun.star.frame.Desktop", context);
      XComponentLoader componentLoader = (XComponentLoader)
UnoRuntime.queryInterface(XComponentLoader.class,   desktop);
   
   
      PropertyValue[] properties = new PropertyValue[1];
      properties[0] = new PropertyValue();
      properties[0].Name = "Hidden";
      properties[0].Value = true;

      
      for(int i = 0; i < Integer.MAX_VALUE; i++) {
         XComponent comp =
componentLoader.loadComponentFromURL("private:factory/swriter", "_blank", 0,
properties);
         XTextDocument doc =
(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, comp);
         doc.dispose();
         System.out.println(i);
      }
      
   }

}

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to