Servoy Eating Up Memory

Hi,

Servoy is eating up a lot of memory.

During initial startup of the IDE, it is 200MB. It increases memory usage as we continuously login to our application. It never goes down even if we close our application.

We are currently using Servoy 5.2.1 and Sybase Anywhere.

Do we need to configure something in Servoy IDE to optimize usage?

Also, what is “None Heap memory” which is stated in the application server home page?

Thanks.

Are you talking here about Developer (Servoy-Eclipse IDE)? What OS are you using? How are you measuring memory usage?

JC

Yes, this is Servoy-Eclipse IDE on Windows 7 Os.

That’s true that it’s using a quite big amount of memory.
Here is a tip I’m using very often: in Eclipse (Servoy Developer) after closing your client, you can run the garbage collector by clicking the little garbage icon at the bottom of the main window. This will free most of the memory allocated to run your solution.

The garbage collector tip is not something you should have to do, as this is something that Java takes care of automatically. Pressing the Garbage Can icon forces Java to do it immediately, instead of automatically when the system is idle and/or when the JVM (Java Virtual Machine) needs additional memory.

If you see the memory going up and up and up, but never going down, there might be a memory leak somewhere. Are you using any third party plugins and/or beans?

200mb of mem usage doesn’t have to be a problem, it all depends on the size of your solution(s) etc. etc.

Paul

How can we trace which bean/plugin has a memory leak?!
I had a look at Java VisualVM but it just shows the whole Servoy process memory usage :roll:

I have done a test using Java VisualVM.
When I have started Servoy Developer, the Heap Allocated was at 100MB and Heap Used around 50MB.
When I have launched a Smart Client, the Heap Allocated went to 200MB and the Heap Used around 120MB.
When I have closed the Smart Client, the Heap Used when down to around 50MB but the Heap Allocated didn’t change. 10 minutes after nothing changed and running a garbage collection didn’t change it as well.
I had to close Servoy Developer to free the memory.

As far as I understand, allocated memory is never given back to the OS!
That is something we have to wait for in Java 7…

all this behavior is completely normal, java doesn’t give back memory as harjo says.

And if you just start the developer then it is in an initial state.
If you open editors, switch to different perspectives or open a smart or web debug client.
Then more and more is loaded in, because everything is lazy.

But when you have touched everything you in a normal day do then the allocated memory should stabilize.
Of course you use loads of temp memory so the used memory is constantly in flux.

my java eclipse is using around 300MB, it can max out to 384MB which should normally also be enough for the servoy developer.

I quite concerned about memory usage because my solution is using quite a lot of memory.
How can we detect what is using the memory in our solution?
Paul spoke about beans/plugins, but how to detect which one? What is the most memory consuming in solutions except graphics? Big foundsets?

In a more general question, how can we trace memory usage to improve our solution?

to improve performance for a smart client you should only really look at one thing:

make as little calls to the server as possible…

thats what makes the performance. That the client uses some memory doesnt make it slower (or it hits the max memory threshold, thats bad)

Big foundsets are not a big problem, ofcourse if you have a foundset of 1M records and you really want to go to the 9.999.999 record that will consume a lot (all 1M pk’s must then be in memory)

Records of a foundset are cached, only a few are really hold on to.

Speed is not really our issue. It’s the memory usage that we would like to limit.
Our solution starts at 150MB and can reach sometimes 400MB which is still ok for todays laptops. But considering that people are using other applications at the same time (Outlook, MS Office, etc…) this amount might be annoying. :roll:

if you give the clients that max memory, then it could start using that because of all the caching…
doesnt mean you really have to give people that much mem. just test with a max cap of 256MB

Yes, we will have to try that I guess and check if it’s not slowing down too much users. :roll:

what you always can do is install JDK6 on one of your clients.

and then in the jdk6\bin dir you have a tool called jvisualvm
that can then connect to your running app and there you can see everything you want in you running smart client.
Don’t try to profile the smart client thats inside a developer, thats completely different.

one note extra:

you can use jvisualvm ONLY when you start the servoy server with the servoy_server.bat
if you start the application server as a (windows) service, jvisualvm does’nt see that process as a java process… :-(

Not sure if I’m in the same problem at all, but I am having a massive problem today with Servoy I can’t figure out. All of a sudden when I click on a method, Servoy goes haywire and eats all of the memory of the machine while (according to profiler) doing nothing at all. See attached screen shot. It does eventually calm down and run the method.
[attachment=0]Screen shot 2010-10-06 at 10.11.18 AM.png[/attachment]

This is happening at the client as well on PCs (using a PC Server and reported by two PC clients who say task manager reports Servoy has up to 50% of their memory and nothing is happening.

if the developer does that then go to the admin page and dump the stack