Since, we moved to Servoy 5 we noticed that our tree hangs for 10sec-1min sometimes when we try to scroll the list. We have other lists in our solution (which don’t use the dbtreeview) and they are fine. It seems to happen after we don’t touch the application for several minutes (10-15min or more). When it hangs the processor is always at 100%. Our tree is quite big: more than 400 nodes + their children.
So we tried to use the old dbtreeview bean (from Servoy 4) which was fine, but it is not compatible with Servoy 5.
does it hangs also when you run the smart client from developer ?
if so, dump the stack from the admin page when it hangs so we can see what’s going wrong
Hi,
Sorry for the delay. We are currently trying to reproduce it on Developer. But we think it might be linked to memory usage, and the computer speed seems to influence the hanging length. For some users their client hangs for 1-2min and the maximum we manage to get on the development machines (not on Developer), which are faster machines, is 5sec.
However, we had more feedbacks since last time, and it seems to happen not only when using the treeview. In fact, the pattern seems to be to let the client open, without using it, for 20+min, and then when you come back and try to do an action (which involves memory manipulation), it hangs. People were complaining about the treeview because it’s usually the first component you use in our solution when you start using it.
Is there a way to record some information.feedback on clients machine? Unfortunately the Java console doesn’t display any problem.
I’ll let you know if we manage to reproduce it on Developer and get more details.
Harjo:
you could also check the performance tab in the servoy-admin page. Maybe there are a huge bunch of sql query’s?
By luck, just after I cleared the performance stats and asked a user to let me know when he has got the problem again, it happened again!
So I have jumped on the performance page, but everything looks ok: no query taking, in total time, more than 750ms.
can that customer have the about window open (if possible before it starts else can it open it when it starts and directly when it ends?)
so that he can report the memory usage?
jcompagner:
can that customer have the about window open (if possible before it starts else can it open it when it starts and directly when it ends?)
so that he can report the memory usage?
No we disabled the about menu. But is there a way to open or integrate this memory graph into our program/forms? Something like application.showMemGraph()
Since our last discussion we have made few tests and enabled Servoy memory graph.
As a result, we have noticed that when it hangs, the graph freezes as well, and when it starts responding the memory usage rises strongly as if it was loading lots of information in memory. And then maybe the garbage collector runs and it goes down. Also the processor is at 100% during the freeze.
More generally we have noticed that during a normal usage, the memory rises very progressively/slowly and regularly goes quickly down as if the garbage collector was cleaning the memory.
Here is a stack dump from the server when it hangs (during it): [attachment=0]systeminfo from server when client hanging.txt[/attachment]
PS: we trigger the hanging by not touching the solution for 15min and moving the dbtreeview scroll bar when coming back. Then when scrolling is hangs from 5sec to 1min depending on the computer.
We are using Servoy version 5.0.1 -build 861 with java.version=1.6.0_18 on the server. And 1.6.0_17 on the client tested (Windows 7 Professional, 2GB RAM, 2*1.9GHtz AMD Athlon X2)
the server almost doesnt do anything
It seems to have 1 connection open to a client and thats it.
We are talking here about hanging smart clients right? Not webclients?
For us to see what is happening is to see a memory dump and/or stacktrace of a client instead of the server.
if you have installed JDK (so not the jre) of java 6
then in the bin dir of that install you have a program called jvisualvm.exe
if you start that program, you can connect to a running smart client instance and you could trigger that stack dumps and memory dumps for that local client.
Yes it’s doing this only with the Smart Client.
I have Java VisualVM running now. I only see the options “Thread Dump” and “Heap Dump”. Is that the ones you need, or are there more actions I should do?
So, I tried to take the dumps while it was frozen. But it froze Java VisualVM as well: the graphs were frozen and when I asked for a dump nothing happened.
After 10min waiting, I have killed the Smart Client. It directly unlocked Java VisualVM. Obviously I got error message saying that it couldn’t take dumps (because the Smart Client Process was dead). And here is a screenshot of the graphs after that (hanging started at 13H52): [attachment=0]Capture.PNG[/attachment]
Ok, this time it did freeze the Java VisualVM graphs and I manged to get dumps!
[attachment=2]Thread_Dump.txt[/attachment] [attachment=1]Heap_Dump.txt[/attachment]
The graphs (hanging starts at 14H33): [attachment=0]Capture.PNG[/attachment]
Actually the graphs are quite impressive! The Heap went crazy and the CPU was at 50% (100% as I use Windows 7 32bit on a 64bit computer). In fact the heap seemed to keep on growing and being garbage collected.
Hope these information help. If more needed, I still have the Smart Client Process tab open.
ok it is not a memory problem
You can see that also in the screen shots, there is almost no memory used. (used 47MB, 128MB allocated with a max of 536)
But somehow the tree is constantly trigging repaints and recalculations…
i think it is somehow in an endless loop.
will investigate.
Here are the dumps:
[attachment=2]Thread_Dump_5.1.1.txt[/attachment] [attachment=1]Heap_Dump_5.1.1.txt[/attachment]
[attachment=0]Capture.PNG[/attachment]
Also here are some details that might help you in your investigations: depending on the database we have different tree sizes. With a tree of 1500+ nodes it hangs. But with a tree of 1000 it doesn’t seem to hang. We have tried to put all the nodes under 1 parent node to see if it was liken to the number of roots but it didn’t change anything. And it hangs usually when you scroll the tree after 15min without touching the application.
In Servoy 4, nobody noticed this hanging and our trees were roughly the same size. But I cannot guaranty it didn’t happen.
can you give us some examples what you exactly do in the tree
A calculation seems to be shown in that tree and that calculation ask for a relation. Does that relation also have nodes again in the tree?
These are the binding and calculations that are used in the tree. The binding for the tree does not include any of the relations used in the calculations.
_binding = elements.bn_tree_live_assets.createBinding('ag','tbl_assets');
_binding.setImageURLDataprovider('cal_asset_icon');
_binding.setNRelationName('tbl_assets_to_tbl_assets_parent_child');
_binding.setTextDataprovider('cal_asset_tree');
_binding.setMethodToCallOnClick(forms.frm_navigation_tree_ag.NodeSelected,'fld_id');
function cal_asset_icon()
{
return 'media:///Assets.gif';
}
function cal_asset_tree()
{
var v_asset_tree = fld_asset_id + ' - ' + fld_asset_title;
try{
if (tbl_assets_to_tbl_assets_users_groups.fld_id != null) {
if (tbl_assets_to_tbl_assets_users_groups.tbl_assets_users_groups_to_tbl_users_in_groups.fld_id == null) {
v_asset_tree += ' (Restricted)';
}
}
} catch (e) {}
return v_asset_tree;
}
But if it was a problem of calculation or relation, why doesn’t it hang at the application startup (instead of 15min after doing nothing), because it runs it at the start to build the tree?!