Forms disappearing

Hi all,

We have just upgraded to Servoy 5.1.4 and a couple of users are reporting a strange problem.
I create the forms dynamically:

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"3CDF43FA-C893-422C-9AC4-D498C8918A15"}
 */
function on_show(firstShow, event) {
	var form_missing = (! forms.research_list_notes);
	if (firstShow || form_missing) {
		if (application.createNewFormInstance('crm_notes_list_panel', 'research_list_notes')) {
			elements.tabs_70.addTab(forms.research_list_notes, 'Notes', 'Notes', null, null, null, null, 'project_research_lists_to_all_notes', 2);
		}
		forms.research_list_notes.elements.new_note.text = "New Note";
		if(! firstShow) application.output('forms.research_list_notes missing!');
	}
}

This is on a tab-panel inside a tab-panel.
The users report that after navigating around the system and coming back to the screen the form is gone… and they have to restart Servoy client.

Any ideas of what may be causing this?

Christian

This should not really happen, even if they navigate to somewhere else where you also display that form then when you go back
the form should be placed back in (you cant show a form on 2 places at the same time)

The same for if they navigate way for a quite a long time and touch many other forms that specific form is cleaned up and destroyed
But that again shouldnt be a problem because if you navigate back we should recreate it.

are you sure you dont call removeForm() (History or SolutionModel) somewhere?

you could try to keep a reference, make a global variable:

globals.myform = forms.research_list_notes

that will make sure it cant be destroyed.

jcompagner:
are you sure you dont call removeForm() (History or SolutionModel) somewhere?

Not touching the SolutionModel yet, but it looks interesting.
Will try to reference with global variables and see what happens.

I

Do these globals to reference forms need to be of particular type? TEXT, MEDIA?

they have to be of type media

I have just uploaded the changes. Let’s see if it helps.

Now the question is: ‘Why is Servoy trying to reclaim memory by getting rid of forms?’.
I’m wondering if my Servoy clients or the server need more memory.

  • I’m using the calendar bean.
  • There are lots of forms and about 80 tables.
  • People are storing documents (Word, PDFs etc) in the database.

What kind of setting do I need to change?

for a smart client it depends on how much memory you give the smart client (see the admin page settings)
we are flushing forms so that not everything is kept in memory and a client will end up with an out of mem exception.
How many forms is based on how much mem a client can have if that is more then 200M it can hold 128 forms in memory if less then 200M 64 if less then 100M 32 forms.

Hi Jan,

Just to let you know, this did not work so we have reverted to 3.5.12 for now.
At least it is really easy to do with launchctl on Mac OS X:

Kick users out, shut down. Then with com.servoy.plist and com.servoy5.plist it becomes:

sudo launchclt -w unload /Library/LaunchDaemons/com.servoy5.plist
sudo launchclt -w load /Library/LaunchDaemons/com.servoy.plist

We are going to do some testing out of hours with more memory assigned to the clients to see if this makes the problem go away.
We were running 5.1.2 with the default 64MB setting. I noticed that our 3.5.12 is set to 256MB.

thats a big difference above 200M is 128 Forms below 100 is only 32…
So it is really possible that that will cause way more destroys…

You can by the way test it your self also.

Make that form like you do now, so creating a new form instance and adding it as a tab
then go to 32+ other forms (make some sample forms like sampl1,2,3,4)
then back to the “normal” form.

If that form is then disappeared, please make case with that sample.
Because it can be that we destroy it, but if you go back we always should reconstruct it for you.
Also the main form (where that tab is on) can be gone of course, But you have an onshow (that is triggered then again) which should add that tab back…