Home » Eclipse Projects » Eclipse Platform » Howto terminate external editor launched with IEditorLauncher or force GC?
Howto terminate external editor launched with IEditorLauncher or force GC? [message #282465] |
Mon, 14 March 2005 05:05  |
Eclipse User |
|
|
|
Originally posted by: de_klutzie.yahoo.com
Hi people~
I'm writing a plugin for Eclipse 3, and in my plugin, user is able to
launch an external editor. I'm implementing the
org.eclipse.ui.IEditorLauncher, and the open(IPath) API is used to launch
my external editor. My editor is a Frame, which allows me to edit some of
my stuff.
I realize when the external editor is launched, it is actually using the
same VM which eclipse is using, and of course, memory usage of this VM
increased whenever i launch the editor. However when I close my editor,
the memory usage remains the same (it doesn't drop).
Is there anyway to solve this problem? I've tried to de-reference all the
instances that i've created and called a garbage collection, but it
doesn't help. Calling System.exit(int) will definately wont help as the
whole Eclipse will be terminated.
Is there a way to terminate this external editor? Or to free up the memory
usage?
And by the way, i've tried to force a garbage collection within my editor,
but it doesnt seem to be working. I've tried to run my editor in a
standalone version (not in eclipse) and profiled the execution, the
garbage collection works, and it actually free up the memory, but not in
the eclipse environment. Any idea?
Would really appreciate the help.
Thanks
klutzie
|
|
|
Re: Howto terminate external editor launched with IEditorLauncher or force GC? [message #282483 is a reply to message #282465] |
Mon, 14 March 2005 13:38   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
klutzie wrote:
> Hi people~
>
> I'm writing a plugin for Eclipse 3, and in my plugin, user is able to
> launch an external editor. I'm implementing the
> org.eclipse.ui.IEditorLauncher, and the open(IPath) API is used to
> launch my external editor. My editor is a Frame, which allows me to edit
> some of my stuff.
>
> I realize when the external editor is launched, it is actually using the
> same VM which eclipse is using, and of course, memory usage of this VM
> increased whenever i launch the editor. However when I close my editor,
> the memory usage remains the same (it doesn't drop).
>
According to whom? Are you using the windows task manager or Linux
equivalent to check the memory, or java.lang.System calls?
> Is there anyway to solve this problem? I've tried to de-reference all
> the instances that i've created and called a garbage collection, but it
> doesn't help. Calling System.exit(int) will definately wont help as the
> whole Eclipse will be terminated.
>
Do you think you have a memory leak? Or do you just not like seeing the
number so high? You can't force garbage collection, you can only
request it. Nothing is guaranteed to be done though. If you really
want to see the garbage collector run to find out if one of your classes
is being collected or not, you can add an array of say, 1,000,000 byte
to one of your classes, and I think Java will be more agressive at
collecting it just so you can see what is goign on.
> Is there a way to terminate this external editor? Or to free up the
> memory usage?
>
The memory will be reclaimed when the JVM requires it. Not a minute
before, unless repeated calls to GC may get you back a few bytes if they
are not referenced (and your lucky)
> And by the way, i've tried to force a garbage collection within my
> editor, but it doesnt seem to be working. I've tried to run my editor in
> a standalone version (not in eclipse) and profiled the execution, the
> garbage collection works, and it actually free up the memory, but not in
> the eclipse environment. Any idea?
>
The JVM is not going to be giving back memory to the OS if that is what
you are wondering. You can adjust the JVM memory settings with stuff
like -Xmx100m and -Xms50m.
>
> Would really appreciate the help.
>
> Thanks
>
>
> klutzie
>
If you are DEAD SET on seeing that memory back try -Xincgc to turn on
the incremental garbage collector.
Hope that helped,
CL
|
|
|
Re: Howto terminate external editor launched with IEditorLauncher or force GC? [message #282497 is a reply to message #282483] |
Mon, 14 March 2005 23:22   |
Eclipse User |
|
|
|
Originally posted by: de_klutzie.yahoo.com
Hi CL, thanks for the fast reply.
Yes, I'm using the Window Task Manager to check for the memory usage.
The scenario is like this. The editor for my plugin works just fine for
the first few instances, but after that, it started to become slower and
slower, and in the end, it hangs. I realized there are continuous increase
of the memory usage for my eclipse (from the Windows Task Manager),
everytime when i load my editor. Somehow the resources cannot be released,
even when the memory usage reaches the peak, thus causing my eclipse and
editor to hang. Things resume normal after i restart my eclipse.
I've tried to use JProfiler to profile a standalone version of my editor
(running outside eclipse), and everytime when I close a window in my
editor (my editor may consist more than one window), I call System.gc(),
and it works. In JProfiler, it shows that resources are actually released.
However it doesn't seems to be working when i run my editor within eclipse.
My editor will be used by other developers, and thus it may not be a good
approach to ask the developers to set parameters for their eclipse. But i
will definately try out the incremental garbage collection thingy.
Any suggestion, anyone?
klutzie
-----------------------------------------
CL [dnoyeb] Gilbert wrote:
> klutzie wrote:
>> Hi people~
>>
>> I'm writing a plugin for Eclipse 3, and in my plugin, user is able to
>> launch an external editor. I'm implementing the
>> org.eclipse.ui.IEditorLauncher, and the open(IPath) API is used to
>> launch my external editor. My editor is a Frame, which allows me to edit
>> some of my stuff.
>>
>> I realize when the external editor is launched, it is actually using the
>> same VM which eclipse is using, and of course, memory usage of this VM
>> increased whenever i launch the editor. However when I close my editor,
>> the memory usage remains the same (it doesn't drop).
>>
> According to whom? Are you using the windows task manager or Linux
> equivalent to check the memory, or java.lang.System calls?
>> Is there anyway to solve this problem? I've tried to de-reference all
>> the instances that i've created and called a garbage collection, but it
>> doesn't help. Calling System.exit(int) will definately wont help as the
>> whole Eclipse will be terminated.
>>
> Do you think you have a memory leak? Or do you just not like seeing the
> number so high? You can't force garbage collection, you can only
> request it. Nothing is guaranteed to be done though. If you really
> want to see the garbage collector run to find out if one of your classes
> is being collected or not, you can add an array of say, 1,000,000 byte
> to one of your classes, and I think Java will be more agressive at
> collecting it just so you can see what is goign on.
>> Is there a way to terminate this external editor? Or to free up the
>> memory usage?
>>
> The memory will be reclaimed when the JVM requires it. Not a minute
> before, unless repeated calls to GC may get you back a few bytes if they
> are not referenced (and your lucky)
>> And by the way, i've tried to force a garbage collection within my
>> editor, but it doesnt seem to be working. I've tried to run my editor in
>> a standalone version (not in eclipse) and profiled the execution, the
>> garbage collection works, and it actually free up the memory, but not in
>> the eclipse environment. Any idea?
>>
> The JVM is not going to be giving back memory to the OS if that is what
> you are wondering. You can adjust the JVM memory settings with stuff
> like -Xmx100m and -Xms50m.
>>
>> Would really appreciate the help.
>>
>> Thanks
>>
>>
>> klutzie
>>
> If you are DEAD SET on seeing that memory back try -Xincgc to turn on
> the incremental garbage collector.
> Hope that helped,
> CL
|
|
|
Re: Howto terminate external editor launched with IEditorLauncher or force GC? [message #282514 is a reply to message #282497] |
Tue, 15 March 2005 09:13   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Looks like you have a memory leak and the incremental GC is not going to
help you. Im not familiar with JProfiler, but if it can, you should
find what is holding on to references to your Frame. Somehow after the
Frame is closed, the reference is not being released.
I have had to jump through hoops myself with my editors to ensure
Eclipse does not hold onto them. Such as making my IEditorInput not
persistable, and making it light weight since the IEditorInputs may be
held onto by the eclipse architecture. But my editors are internal.
klutzie wrote:
> Hi CL, thanks for the fast reply.
>
> Yes, I'm using the Window Task Manager to check for the memory usage.
>
> The scenario is like this. The editor for my plugin works just fine for
> the first few instances, but after that, it started to become slower and
> slower, and in the end, it hangs. I realized there are continuous
> increase of the memory usage for my eclipse (from the Windows Task
> Manager), everytime when i load my editor. Somehow the resources cannot
> be released, even when the memory usage reaches the peak, thus causing
> my eclipse and editor to hang. Things resume normal after i restart my
> eclipse.
>
> I've tried to use JProfiler to profile a standalone version of my editor
> (running outside eclipse), and everytime when I close a window in my
> editor (my editor may consist more than one window), I call System.gc(),
> and it works. In JProfiler, it shows that resources are actually
> released. However it doesn't seems to be working when i run my editor
> within eclipse.
>
> My editor will be used by other developers, and thus it may not be a
> good approach to ask the developers to set parameters for their eclipse.
> But i will definately try out the incremental garbage collection thingy.
>
>
> Any suggestion, anyone?
>
>
> klutzie
>
>
> -----------------------------------------
>
> CL [dnoyeb] Gilbert wrote:
>
>> klutzie wrote:
>>
>>> Hi people~
>>>
>>> I'm writing a plugin for Eclipse 3, and in my plugin, user is able to
>>> launch an external editor. I'm implementing the
>>> org.eclipse.ui.IEditorLauncher, and the open(IPath) API is used to
>>> launch my external editor. My editor is a Frame, which allows me to
>>> edit some of my stuff.
>>>
>>> I realize when the external editor is launched, it is actually using
>>> the same VM which eclipse is using, and of course, memory usage of
>>> this VM increased whenever i launch the editor. However when I close
>>> my editor, the memory usage remains the same (it doesn't drop).
>>>
>
>> According to whom? Are you using the windows task manager or Linux
>> equivalent to check the memory, or java.lang.System calls?
>
>
>
>>> Is there anyway to solve this problem? I've tried to de-reference all
>>> the instances that i've created and called a garbage collection, but
>>> it doesn't help. Calling System.exit(int) will definately wont help
>>> as the whole Eclipse will be terminated.
>>>
>
>> Do you think you have a memory leak? Or do you just not like seeing
>> the number so high? You can't force garbage collection, you can only
>> request it. Nothing is guaranteed to be done though. If you really
>> want to see the garbage collector run to find out if one of your
>> classes is being collected or not, you can add an array of say,
>> 1,000,000 byte to one of your classes, and I think Java will be more
>> agressive at collecting it just so you can see what is goign on.
>
>
>
>>> Is there a way to terminate this external editor? Or to free up the
>>> memory usage?
>>>
>
>> The memory will be reclaimed when the JVM requires it. Not a minute
>> before, unless repeated calls to GC may get you back a few bytes if
>> they are not referenced (and your lucky)
>
>
>
>>> And by the way, i've tried to force a garbage collection within my
>>> editor, but it doesnt seem to be working. I've tried to run my editor
>>> in a standalone version (not in eclipse) and profiled the execution,
>>> the garbage collection works, and it actually free up the memory, but
>>> not in the eclipse environment. Any idea?
>>>
>
>> The JVM is not going to be giving back memory to the OS if that is
>> what you are wondering. You can adjust the JVM memory settings with
>> stuff like -Xmx100m and -Xms50m.
>
>
>>>
>>> Would really appreciate the help.
>>>
>>> Thanks
>>>
>>>
>>> klutzie
>>>
>
>> If you are DEAD SET on seeing that memory back try -Xincgc to turn on
>> the incremental garbage collector.
>
>
>
>> Hope that helped,
>
>
>
>> CL
>
>
>
|
|
|
Re: Howto terminate external editor launched with IEditorLauncher or force GC? [message #282536 is a reply to message #282514] |
Tue, 15 March 2005 19:51   |
Eclipse User |
|
|
|
Originally posted by: de_klutzie.yahoo.com
The thing that is bugging is that, how come when i call System.gc() when
im running my editor in a standalone version, the resources can be
released, but not within eclipse...
anyway, thanks a lot CL for sharing your knowledge. :)
klutzie
-------------------------------
CL [dnoyeb] Gilbert wrote:
> Looks like you have a memory leak and the incremental GC is not going to
> help you. Im not familiar with JProfiler, but if it can, you should
> find what is holding on to references to your Frame. Somehow after the
> Frame is closed, the reference is not being released.
> I have had to jump through hoops myself with my editors to ensure
> Eclipse does not hold onto them. Such as making my IEditorInput not
> persistable, and making it light weight since the IEditorInputs may be
> held onto by the eclipse architecture. But my editors are internal.
> klutzie wrote:
>> Hi CL, thanks for the fast reply.
>>
>> Yes, I'm using the Window Task Manager to check for the memory usage.
>>
>> The scenario is like this. The editor for my plugin works just fine for
>> the first few instances, but after that, it started to become slower and
>> slower, and in the end, it hangs. I realized there are continuous
>> increase of the memory usage for my eclipse (from the Windows Task
>> Manager), everytime when i load my editor. Somehow the resources cannot
>> be released, even when the memory usage reaches the peak, thus causing
>> my eclipse and editor to hang. Things resume normal after i restart my
>> eclipse.
>>
>> I've tried to use JProfiler to profile a standalone version of my editor
>> (running outside eclipse), and everytime when I close a window in my
>> editor (my editor may consist more than one window), I call System.gc(),
>> and it works. In JProfiler, it shows that resources are actually
>> released. However it doesn't seems to be working when i run my editor
>> within eclipse.
>>
>> My editor will be used by other developers, and thus it may not be a
>> good approach to ask the developers to set parameters for their eclipse.
>> But i will definately try out the incremental garbage collection thingy.
>>
>>
>> Any suggestion, anyone?
>>
>>
>> klutzie
>>
>>
>> -----------------------------------------
>>
>> CL [dnoyeb] Gilbert wrote:
>>
>>> klutzie wrote:
>>>
>>>> Hi people~
>>>>
>>>> I'm writing a plugin for Eclipse 3, and in my plugin, user is able to
>>>> launch an external editor. I'm implementing the
>>>> org.eclipse.ui.IEditorLauncher, and the open(IPath) API is used to
>>>> launch my external editor. My editor is a Frame, which allows me to
>>>> edit some of my stuff.
>>>>
>>>> I realize when the external editor is launched, it is actually using
>>>> the same VM which eclipse is using, and of course, memory usage of
>>>> this VM increased whenever i launch the editor. However when I close
>>>> my editor, the memory usage remains the same (it doesn't drop).
>>>>
>>
>>> According to whom? Are you using the windows task manager or Linux
>>> equivalent to check the memory, or java.lang.System calls?
>>
>>
>>
>>>> Is there anyway to solve this problem? I've tried to de-reference all
>>>> the instances that i've created and called a garbage collection, but
>>>> it doesn't help. Calling System.exit(int) will definately wont help
>>>> as the whole Eclipse will be terminated.
>>>>
>>
>>> Do you think you have a memory leak? Or do you just not like seeing
>>> the number so high? You can't force garbage collection, you can only
>>> request it. Nothing is guaranteed to be done though. If you really
>>> want to see the garbage collector run to find out if one of your
>>> classes is being collected or not, you can add an array of say,
>>> 1,000,000 byte to one of your classes, and I think Java will be more
>>> agressive at collecting it just so you can see what is goign on.
>>
>>
>>
>>>> Is there a way to terminate this external editor? Or to free up the
>>>> memory usage?
>>>>
>>
>>> The memory will be reclaimed when the JVM requires it. Not a minute
>>> before, unless repeated calls to GC may get you back a few bytes if
>>> they are not referenced (and your lucky)
>>
>>
>>
>>>> And by the way, i've tried to force a garbage collection within my
>>>> editor, but it doesnt seem to be working. I've tried to run my editor
>>>> in a standalone version (not in eclipse) and profiled the execution,
>>>> the garbage collection works, and it actually free up the memory, but
>>>> not in the eclipse environment. Any idea?
>>>>
>>
>>> The JVM is not going to be giving back memory to the OS if that is
>>> what you are wondering. You can adjust the JVM memory settings with
>>> stuff like -Xmx100m and -Xms50m.
>>
>>
>>>>
>>>> Would really appreciate the help.
>>>>
>>>> Thanks
>>>>
>>>>
>>>> klutzie
>>>>
>>
>>> If you are DEAD SET on seeing that memory back try -Xincgc to turn on
>>> the incremental garbage collector.
>>
>>
>>
>>> Hope that helped,
>>
>>
>>
>>> CL
>>
>>
>>
|
|
|
Re: Howto terminate external editor launched with IEditorLauncher or force GC? [message #282558 is a reply to message #282536] |
Wed, 16 March 2005 08:53   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Because in Eclipse the resources are still being held onto. You have to
determine what object is still holding a reference to your editor within
eclipse.
The GC will only release memory from objects that are not presently
being used. some class in eclipse is still using your object, and you
should be able ot use JProfiler to figure out which.
CL
klutzie wrote:
> The thing that is bugging is that, how come when i call System.gc() when
> im running my editor in a standalone version, the resources can be
> released, but not within eclipse...
>
> anyway, thanks a lot CL for sharing your knowledge. :)
>
>
> klutzie
> -------------------------------
>
> CL [dnoyeb] Gilbert wrote:
>
>> Looks like you have a memory leak and the incremental GC is not going
>> to help you. Im not familiar with JProfiler, but if it can, you
>> should find what is holding on to references to your Frame. Somehow
>> after the Frame is closed, the reference is not being released.
>
>
>> I have had to jump through hoops myself with my editors to ensure
>> Eclipse does not hold onto them. Such as making my IEditorInput not
>> persistable, and making it light weight since the IEditorInputs may be
>> held onto by the eclipse architecture. But my editors are internal.
>
>
>
>
>> klutzie wrote:
>>
>>> Hi CL, thanks for the fast reply.
>>>
>>> Yes, I'm using the Window Task Manager to check for the memory usage.
>>>
>>> The scenario is like this. The editor for my plugin works just fine
>>> for the first few instances, but after that, it started to become
>>> slower and slower, and in the end, it hangs. I realized there are
>>> continuous increase of the memory usage for my eclipse (from the
>>> Windows Task Manager), everytime when i load my editor. Somehow the
>>> resources cannot be released, even when the memory usage reaches the
>>> peak, thus causing my eclipse and editor to hang. Things resume
>>> normal after i restart my eclipse.
>>>
>>> I've tried to use JProfiler to profile a standalone version of my
>>> editor (running outside eclipse), and everytime when I close a window
>>> in my editor (my editor may consist more than one window), I call
>>> System.gc(), and it works. In JProfiler, it shows that resources are
>>> actually released. However it doesn't seems to be working when i run
>>> my editor within eclipse.
>>>
>>> My editor will be used by other developers, and thus it may not be a
>>> good approach to ask the developers to set parameters for their
>>> eclipse. But i will definately try out the incremental garbage
>>> collection thingy.
>>>
>>>
>>> Any suggestion, anyone?
>>>
>>>
>>> klutzie
>>>
>>>
>>> -----------------------------------------
>>>
>>> CL [dnoyeb] Gilbert wrote:
>>>
>>>> klutzie wrote:
>>>>
>>>>> Hi people~
>>>>>
>>>>> I'm writing a plugin for Eclipse 3, and in my plugin, user is able
>>>>> to launch an external editor. I'm implementing the
>>>>> org.eclipse.ui.IEditorLauncher, and the open(IPath) API is used to
>>>>> launch my external editor. My editor is a Frame, which allows me to
>>>>> edit some of my stuff.
>>>>>
>>>>> I realize when the external editor is launched, it is actually
>>>>> using the same VM which eclipse is using, and of course, memory
>>>>> usage of this VM increased whenever i launch the editor. However
>>>>> when I close my editor, the memory usage remains the same (it
>>>>> doesn't drop).
>>>>>
>>>
>>>> According to whom? Are you using the windows task manager or Linux
>>>> equivalent to check the memory, or java.lang.System calls?
>>>
>>>
>>>
>>>
>>>>> Is there anyway to solve this problem? I've tried to de-reference
>>>>> all the instances that i've created and called a garbage
>>>>> collection, but it doesn't help. Calling System.exit(int) will
>>>>> definately wont help as the whole Eclipse will be terminated.
>>>>>
>>>
>>>> Do you think you have a memory leak? Or do you just not like seeing
>>>> the number so high? You can't force garbage collection, you can
>>>> only request it. Nothing is guaranteed to be done though. If you
>>>> really want to see the garbage collector run to find out if one of
>>>> your classes is being collected or not, you can add an array of say,
>>>> 1,000,000 byte to one of your classes, and I think Java will be more
>>>> agressive at collecting it just so you can see what is goign on.
>>>
>>>
>>>
>>>
>>>>> Is there a way to terminate this external editor? Or to free up the
>>>>> memory usage?
>>>>>
>>>
>>>> The memory will be reclaimed when the JVM requires it. Not a minute
>>>> before, unless repeated calls to GC may get you back a few bytes if
>>>> they are not referenced (and your lucky)
>>>
>>>
>>>
>>>
>>>>> And by the way, i've tried to force a garbage collection within my
>>>>> editor, but it doesnt seem to be working. I've tried to run my
>>>>> editor in a standalone version (not in eclipse) and profiled the
>>>>> execution, the garbage collection works, and it actually free up
>>>>> the memory, but not in the eclipse environment. Any idea?
>>>>>
>>>
>>>> The JVM is not going to be giving back memory to the OS if that is
>>>> what you are wondering. You can adjust the JVM memory settings with
>>>> stuff like -Xmx100m and -Xms50m.
>>>
>>>
>>>
>>>>>
>>>>> Would really appreciate the help.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> klutzie
>>>>>
>>>
>>>> If you are DEAD SET on seeing that memory back try -Xincgc to turn
>>>> on the incremental garbage collector.
>>>
>>>
>>>
>>>
>>>> Hope that helped,
>>>
>>>
>>>
>>>
>>>> CL
>>>
>>>
>>>
>>>
>
>
|
|
|
Re: Howto terminate external editor launched with IEditorLauncher or force GC? [message #282627 is a reply to message #282558] |
Wed, 16 March 2005 20:38   |
Eclipse User |
|
|
|
Originally posted by: de_klutzie.yahoo.com
Is there a way to profile the activities in Eclipse? i mean the whole
eclipse runtime? because with JProfiler, I believe i can only profile
class or .jar file, but not .exe file
klutzie
------------------------------------
CL [dnoyeb] Gilbert wrote:
> Because in Eclipse the resources are still being held onto. You have to
> determine what object is still holding a reference to your editor within
> eclipse.
> The GC will only release memory from objects that are not presently
> being used. some class in eclipse is still using your object, and you
> should be able ot use JProfiler to figure out which.
> CL
> klutzie wrote:
>> The thing that is bugging is that, how come when i call System.gc() when
>> im running my editor in a standalone version, the resources can be
>> released, but not within eclipse...
>>
>> anyway, thanks a lot CL for sharing your knowledge. :)
>>
>>
>> klutzie
>> -------------------------------
>>
>> CL [dnoyeb] Gilbert wrote:
>>
>>> Looks like you have a memory leak and the incremental GC is not going
>>> to help you. Im not familiar with JProfiler, but if it can, you
>>> should find what is holding on to references to your Frame. Somehow
>>> after the Frame is closed, the reference is not being released.
>>
>>
>>> I have had to jump through hoops myself with my editors to ensure
>>> Eclipse does not hold onto them. Such as making my IEditorInput not
>>> persistable, and making it light weight since the IEditorInputs may be
>>> held onto by the eclipse architecture. But my editors are internal.
>>
>>
>>
>>
>>> klutzie wrote:
>>>
>>>> Hi CL, thanks for the fast reply.
>>>>
>>>> Yes, I'm using the Window Task Manager to check for the memory usage.
>>>>
>>>> The scenario is like this. The editor for my plugin works just fine
>>>> for the first few instances, but after that, it started to become
>>>> slower and slower, and in the end, it hangs. I realized there are
>>>> continuous increase of the memory usage for my eclipse (from the
>>>> Windows Task Manager), everytime when i load my editor. Somehow the
>>>> resources cannot be released, even when the memory usage reaches the
>>>> peak, thus causing my eclipse and editor to hang. Things resume
>>>> normal after i restart my eclipse.
>>>>
>>>> I've tried to use JProfiler to profile a standalone version of my
>>>> editor (running outside eclipse), and everytime when I close a window
>>>> in my editor (my editor may consist more than one window), I call
>>>> System.gc(), and it works. In JProfiler, it shows that resources are
>>>> actually released. However it doesn't seems to be working when i run
>>>> my editor within eclipse.
>>>>
>>>> My editor will be used by other developers, and thus it may not be a
>>>> good approach to ask the developers to set parameters for their
>>>> eclipse. But i will definately try out the incremental garbage
>>>> collection thingy.
>>>>
>>>>
>>>> Any suggestion, anyone?
>>>>
>>>>
>>>> klutzie
>>>>
>>>>
>>>> -----------------------------------------
>>>>
>>>> CL [dnoyeb] Gilbert wrote:
>>>>
>>>>> klutzie wrote:
>>>>>
>>>>>> Hi people~
>>>>>>
>>>>>> I'm writing a plugin for Eclipse 3, and in my plugin, user is able
>>>>>> to launch an external editor. I'm implementing the
>>>>>> org.eclipse.ui.IEditorLauncher, and the open(IPath) API is used to
>>>>>> launch my external editor. My editor is a Frame, which allows me to
>>>>>> edit some of my stuff.
>>>>>>
>>>>>> I realize when the external editor is launched, it is actually
>>>>>> using the same VM which eclipse is using, and of course, memory
>>>>>> usage of this VM increased whenever i launch the editor. However
>>>>>> when I close my editor, the memory usage remains the same (it
>>>>>> doesn't drop).
>>>>>>
>>>>
>>>>> According to whom? Are you using the windows task manager or Linux
>>>>> equivalent to check the memory, or java.lang.System calls?
>>>>
>>>>
>>>>
>>>>
>>>>>> Is there anyway to solve this problem? I've tried to de-reference
>>>>>> all the instances that i've created and called a garbage
>>>>>> collection, but it doesn't help. Calling System.exit(int) will
>>>>>> definately wont help as the whole Eclipse will be terminated.
>>>>>>
>>>>
>>>>> Do you think you have a memory leak? Or do you just not like seeing
>>>>> the number so high? You can't force garbage collection, you can
>>>>> only request it. Nothing is guaranteed to be done though. If you
>>>>> really want to see the garbage collector run to find out if one of
>>>>> your classes is being collected or not, you can add an array of say,
>>>>> 1,000,000 byte to one of your classes, and I think Java will be more
>>>>> agressive at collecting it just so you can see what is goign on.
>>>>
>>>>
>>>>
>>>>
>>>>>> Is there a way to terminate this external editor? Or to free up the
>>>>>> memory usage?
>>>>>>
>>>>
>>>>> The memory will be reclaimed when the JVM requires it. Not a minute
>>>>> before, unless repeated calls to GC may get you back a few bytes if
>>>>> they are not referenced (and your lucky)
>>>>
>>>>
>>>>
>>>>
>>>>>> And by the way, i've tried to force a garbage collection within my
>>>>>> editor, but it doesnt seem to be working. I've tried to run my
>>>>>> editor in a standalone version (not in eclipse) and profiled the
>>>>>> execution, the garbage collection works, and it actually free up
>>>>>> the memory, but not in the eclipse environment. Any idea?
>>>>>>
>>>>
>>>>> The JVM is not going to be giving back memory to the OS if that is
>>>>> what you are wondering. You can adjust the JVM memory settings with
>>>>> stuff like -Xmx100m and -Xms50m.
>>>>
>>>>
>>>>
>>>>>>
>>>>>> Would really appreciate the help.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> klutzie
>>>>>>
>>>>
>>>>> If you are DEAD SET on seeing that memory back try -Xincgc to turn
>>>>> on the incremental garbage collector.
>>>>
>>>>
>>>>
>>>>
>>>>> Hope that helped,
>>>>
>>>>
>>>>
>>>>
>>>>> CL
>>>>
>>>>
>>>>
>>>>
>>
>>
|
|
| |
Re: Howto terminate external editor launched with IEditorLauncher or force GC? [message #283120 is a reply to message #282632] |
Sat, 26 March 2005 16:43  |
Eclipse User |
|
|
|
Originally posted by: varavamu.yahoo.com
you might be able to use sleak (from the eclipse sqt team). you can find out
more abt it here: http://www.eclipse.org/articles/swt-design-2/sleak.htm
HTH,
Vijay
CL [dnoyeb] Gilbert wrote:
> im sure it can. perhaps ask some jprofiler people. eclipse is pretty
> popular so they will probably have a quick answer for you.
>
>
> CL
>
>
> klutzie wrote:
>
>> Is there a way to profile the activities in Eclipse? i mean the whole
>> eclipse runtime? because with JProfiler, I believe i can only profile
>> class or .jar file, but not .exe file
>>
>> klutzie
>>
>> ------------------------------------
>>
>> CL [dnoyeb] Gilbert wrote:
>>
>>> Because in Eclipse the resources are still being held onto. You have
>>> to determine what object is still holding a reference to your editor
>>> within eclipse.
>>
>>
>>
>>> The GC will only release memory from objects that are not presently
>>> being used. some class in eclipse is still using your object, and
>>> you should be able ot use JProfiler to figure out which.
>>
>>
>>
>>> CL
>>
>>
>>
>>
>>> klutzie wrote:
>>>
|
|
|
Goto Forum:
Current Time: Sat May 10 23:43:38 EDT 2025
Powered by FUDForum. Page generated in 0.04371 seconds
|