Memory Usage after closing project

0
3 comments
Avatar
Permanently deleted user

Marc Salm wrote:

Now I'm working with
-ms16m -mx500m -Xincgc

This seems to work fine. No Internal Errors so far and switching
between projects seems to "consume" less memory.
I just have to keep an eye on the actual heapsize and trigger
GC if it gets to big.


I just worte a plugin, that invokes GC every 60 seconds automatically.
This seems to do the trick for me. Now I can switch between projects
without too much memory consumption. I still use -ms16m -mx500m -Xincgc.
Seems to be a perfect combination for me.

import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import java.awt.*; public class GCThread extends AnAction { public void actionPerformed(AnActionEvent event) { new Thread() { public void run() { while (true) { Runtime.getRuntime().gc(); try { sleep(60000); } catch (InterruptedException e) { } } } }.start(); } } ]]>

Attached you find the jar of the plugin, if you want to use it.
I think it's not worth to put on the wiki, isn't it?

Is there a way to invoke a plugin directly when IDEA is started?
At the moment I have to make one single click.

ciao

Marc Salm
http://www.codebasket.de
--
My software never has bugs. It just develops random features.

0
Avatar
Permanently deleted user

Better to do it inside the Application object, and just start
it on app start.

Marc Salm wrote:


I just worte a plugin, that invokes GC every 60 seconds automatically.
This seems to do the trick for me. Now I can switch between projects
without too much memory consumption. I still use -ms16m -mx500m -Xincgc.
Seems to be a perfect combination for me.

<CODE>
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;

import java.awt.*;

public class GCThread extends AnAction {
public void actionPerformed(AnActionEvent event) {
new Thread() {
public void run() {
while (true) {
Runtime.getRuntime().gc();
try {
sleep(60000);
} catch (InterruptedException e) {
}
}
}
}.start();
}
}
</CODE>

Attached you find the jar of the plugin, if you want to use it.
I think it's not worth to put on the wiki, isn't it?

Is there a way to invoke a plugin directly when IDEA is started?
At the moment I have to make one single click.

ciao

Marc Salm
http://www.codebasket.de
--
My software never has bugs. It just develops random features.


--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0
Avatar
Permanently deleted user

Erb wrote:

Better to do it inside the Application object, and just start
it on app start.


How would I do that?
I didn't dive to deep into the OpenAPI, because I just wanted
a solution for this problem. So I just copied the HelloWorld
example.

ciao

Marc Salm
http://www.codebasket.de
--
My software never has bugs. It just develops random features.

0

Please sign in to leave a comment.