OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Memory leak when using the Uno APIs ???

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Bernie
General User
General User


Joined: 15 Apr 2004
Posts: 28
Location: Grenoble, France

PostPosted: Thu Apr 15, 2004 12:39 am    Post subject: Memory leak when using the Uno APIs ??? Reply with quote

hello.

I'm currently developping a Java/web application which uses the Uno APIs : merging documents and PDF transformation. I launched soffice on my PC ("localhost") and noticed that the memory usage increased approx. by 1 Mbytes at each merge/PDF transform. It seems that the memory used is not released after each run.
I'm using OOo 1.1.1 (it was the same problem with 1.1.0), under Windows 2000, and Java 1.4.1_02.
I wonder if this is a real problem or if i missed something in my java code ? If needed, i'll publish my code !

Thanks in advance.

P.S. : please excuse my very poor english... Sad
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Thu Apr 15, 2004 6:36 am    Post subject: Reply with quote

If you do a GC in Java, does the memory problem in the OOo go away?

What I'm wondering is this. Suppose there are java objects that you no longer use, but that represent real objects over in the OOo process. Your java objects are now available for finalization by the garbage collector. Since they have not yet been collected (and therefore finalize method called), those proxy objects in Java cause their counterpart objects in OOo to still exist.

If you GC does the OOo memory use go down?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Bernie
General User
General User


Joined: 15 Apr 2004
Posts: 28
Location: Grenoble, France

PostPosted: Thu Apr 15, 2004 7:41 am    Post subject: Reply with quote

Danny, thank you for your answer.

I already tried to add "System.gc();" before exiting, but in fact it's not a memory problem of my application but a problem of the program "soffice.exe" on the server (the one which is listening on the port # 8100) It seams that it doesn't free all the memory it needed after ending the process (when my app executes the "dispose" method)

Maybe i forgot something in my code. But i would be astonished that i'd have to explicitely ask the server to free its own memory...
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Thu Apr 15, 2004 8:43 am    Post subject: Reply with quote

If your Java program has ended, and OOo still has not released memory, this would be a pretty strong indication of a memory leak.

Especially if after repeated runs of the Java program, the memory consumption of the OOo grows larger and larger. And after the java program has quit running each time.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Bernie
General User
General User


Joined: 15 Apr 2004
Posts: 28
Location: Grenoble, France

PostPosted: Thu Apr 15, 2004 9:56 am    Post subject: Reply with quote

Yes, it's exactly what happens. After each run, the used memory is increased of about 1 MByte (sometimes less, sometimes more). So the soffice.exe process always grows.

I made several sessions (each with exactly 50 runs) and noticed that fact. After each session, i closed the soffice.exe process and ran it again.

Maybe i should post a bug request ? (but where could i do that ? and am i authorized to do such a thing ?, not beeing a OOo contributor ?)
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Thu Apr 15, 2004 10:27 am    Post subject: Reply with quote

Simply go to www.openoffice.org, create an account, and you can post a bug report.

First do a search for an existing bug report so that you do not post a duplicate.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Bernie
General User
General User


Joined: 15 Apr 2004
Posts: 28
Location: Grenoble, France

PostPosted: Thu Apr 15, 2004 10:31 am    Post subject: Reply with quote

Thanks, Dany, i'll do that if i am sure that such a bug report doesn't exists.
Back to top
View user's profile Send private message
Bernie
General User
General User


Joined: 15 Apr 2004
Posts: 28
Location: Grenoble, France

PostPosted: Sun Apr 18, 2004 7:57 am    Post subject: Reply with quote

In fact, I wonder... I tried both the dispose() and the close() methods : no difference at all. Maybe something else in my code ?

It's rather important, because OOo has to be installed on a server, with a serialiser in order to run only 1 work at a time. But if the used memory increases and never decreases, it will be a mess Rolling Eyes

Has anybody an experience on this subject ? Or some tricks to fix that problem ?

Thanks in advance...
Back to top
View user's profile Send private message
Faust
General User
General User


Joined: 30 Jan 2004
Posts: 11
Location: Turin - Italy

PostPosted: Mon Apr 26, 2004 6:50 am    Post subject: I'm interested in a solution, too. Reply with quote

Unfortunately I cannot help you, but since I plan to use an OOo server for document conversions, too, I'm most interested in any solution to the problem. So if you found out anything, please let me know.

Thanks!

Faust.
_________________
"To define means to limit" (Oscar Wilde)
Back to top
View user's profile Send private message
Bernie
General User
General User


Joined: 15 Apr 2004
Posts: 28
Location: Grenoble, France

PostPosted: Mon Apr 26, 2004 11:01 am    Post subject: Reply with quote

No problem," Doctor" Faust, i'll report if i find something interesting.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group