SMartClient freeze

I am currently doing final tests before full production and the more complex functionality of my application is correctly working in the development environment while is hanging when executed from SmartClient.

I’ve traced down the problem and SmartClient is freezing executing a specific method; in the calling routine there are these two lines:

plugins.dialogs.showInfoDialog( “DEBUG”, “Just before method…”, “OK”);
risultato = forms.DCSGES01.raggruppa_valutazione(scrittura, data_valutaz, modo_valutaz, tipo_valutaz, data_ultima, ag_competenza);

Within method DCSGES01.raggruppa_valutazione() the very first instruction is:
plugins.dialogs.showInfoDialog( “DEBUG”, “Just in the method…”, “OK”);

When executed from the development I am asked with two dialogs.
When executed from SmartClient I only see the first one the application hangs.

What can I do now to fix this issue?

Current development configuration:
Java 1.5_10
Servoy 3.1.5
Client configuration:
Java 1.4.2_11-b06

I’ve already tried to look at VM configuration but I’ve found no solution…
The problem was originally found on Servoy 3.02; upgrading it to 3.1.5 doesn’t solve the issue…
I’ve tried in another development machine installing Java 1.4 but the issue is always there…

If any more information is needed pls ask…

Any help is really appreciated…

Grazie,
Gianni

Hi Gianni,

Not sure what your method does and how much data those parameters hold. But what could be happening is that the client runs out of memory.
My experience is when that happens the method simply stops without any error but the client doesn’t hang. You can still quit the client and such.

Is that what you see ?

If so you need to give the clients more RAM in the server admin pages. (you do need to re-download the clients after that)

Hope this helps.

Hi Robert,

What you described is exactly what is happening…

But…

I’ve tried to apply your advice already before your answer but with no luck…
Considering I am still a novice in Servoy I try here to recap what I 've done:

  • Looking at the developer icon I found it contain a startup parameter “-Xmx256m”…
  • I went into my server admin pages and on the “Servoy Server Home” page I’ve changed in the section “Memory/Performance Settings” the param “servoy.MaxClientHeap” from 64 to 256…these should be megabytes based on Info button…
  • I went than into Java plugin from the client control panel and deleted the cache to force the Servoy client to reload…
  • I restarted the application, retested and…NOTHING CHANGED! The client is still stopping to run always in the same point…I confirm you again I can correctly close it but nothing else…

Have I misunderstood something ?

What else can I do?

Tnks for any help…
Gianni

Hi Robert,

I’ve tried also to upgrade Java on the client to 1.5_11 but with no luck…

What else can I try to do?

Tnks,
Gianni

Hi Gianni,

You indeed have to clear your cache but also remove the .servoy directory in your home directory.
You might not see it because it’s a hidden folder.
After you have done all this run the client and open the about window. This will show you how much ram is used.
Then run your method and see if it max out. If it’s not then it’s not your RAM but something else.

Hope this helps.

Hi Robert (and all the others),

I cleared the .servoy directory on the server machine (it was not re-created restarting the server nor the client…is this right?)
I tried again on an already available client clearing the cache…NOTHING CHANGED!
I tried to install a new client never used before…NOTHING CHANGED!

The functionality that is freezing is the more complex of my application but is not extremely complex (I have written in the past much more complex apps…) and is NOT crunching a lot of data.

I tried to monitor the memory used from the development environment when executing the freezing function opening the window ? → About from the pulldown menu.
From the starting to the closing point the allocated memory was 57568k and the used memory varying from about 20000k to about 35000k…
Based on these information I am supposing is NOT a memory problem…

By the way: I tried with different Java VM installed (1.3.1, 1.4.2, 1.5.10, 1.5.11) but the problem is ALWAYS there…

It was properly working from the Servoy Smart Client until the functionality was really simple…Then I needed to add more data crunching and it was done…
The new methods added are not adding levels on the stack…they are on the same level as others…I mean: one method is closed and another one is executed…

I feel myself locked…without any idea on how to exit from the problem…

What else could I check?
What could be different between the development environment and the SmartClient on the same machine?
Is anyone else having problem(s) similar to this one?

Should I directly raise an issue to the Servoy lab?

Tnks for any help!

Ciao,
Gianni

Gianni,

Set the ‘Show Console’ checkbox in the java webstart control panel on the client.
If you now start a smart client, a log window will appear.
Maybe you will see something in there when the problem occurs.

Rob

Thnks rgansevles…

DONE!

Attached is available trace from the Java console:

What can we do now?

Ciao,
Gianni

TraceJava.txt (4.09 KB)

I have discovered a similar issue in the client. After a lengthy operation I show a simple dialog (“Done!”). I can see from my output in the client trace that the method has finished, but the client window is completely “dead” (grey) and never shows the dialog. I don’t know if that is somehow related to showing the dialog or not, but it seems a coincidence…

I have not managed to see the dialog and tried for a few hours with server restarts, client cache clearing etc. I never get an error. The last I see is my output from shortly before the dialog is shown.

Gianni,

Servoy uses a javascript engine that compiles methods the first time they are used, this compiling seems to fail in your solution.

The reason it works in developer is that in developer javascript methods are not compiled but interpreted (otherwise the debugger doesn’t work).

Could it be that the method that you are calling (raggruppa_valutazione) is very big?
If so, try splitting it in two and call the second one at the end of the first one.

Rob

Hi all,

I checked my app trying to verify complexity and reducing it…

The method that generated the Java exception is big but NOT the BIGGEST…

It was before the reengineering 1186 lines long; now it is splitted in three parts and the main part is still 886 lines long but IT WORKS NOW on the SmartClient…

The biggest method I have in my app is about 1300lines long; it could be splitted obviously but I am wondering which could be the basic rule about complexity…

Could I assume that:

A METHOD SHOULD NEVER BE LONGER THAT 1000 LINES?

But more questions raise in my mind (more or less related…):

MAX CHARACTERS A METHOD?

MAX NESTED FLOW CONTROL LEVELS IN A METHOD?

Where could I find documentazion on SERVOY limits?

By the way: A BIG TNKS for helping me to solve my problem!

Ciao,
Gianni

There are no other limits than that you should make sure that you understand the method yourself.

Having that said it is good practice to create a method for one purpose and not too generic. This will help you to maintain your solution.