Hi,
I've got a question about the memory used by reports. While developing I run reports often multiple times in a row for example for chronometry, etc.
Yesterday we experienced trouble with the ARIS Server starting that very moment I ran a comparison of several functions' execution times. Finally found out server's memory was at maximum and the problem could be solved by restarting the ARIS server service.
So, is there a way to return memory allocated by a report and its objects?
I'm not much of a javascript-guru, but I guess there is no way to do in the code. But maybe there is a way to configure the ARIS report service, if any ...
Hope anyone has an idea. Thnks a lot.
Regards,
Maik
PLease see Aris Installation&AdminGuide.pdf in the docs folder of your installation for detailed procedure:
You can allocate more RAM at startup of the server in server\config\userServerSettings.cfg
But there is limits for the max per Java Virtual Machine, depending on your platform (Win or *ix, 32 or 64bit)
Hello,
I've been monitoring my Aris Business Server and I've noticed that even if I increase de allocated memory for the java VM, still it is not released after running any report. In fact it just keeps on increasing after each report execution, so after a while (it could be weeks), it will eventually run out of memory again and I'll need to restart the server.
Any ideas?
Thanks in advance
Hi Fernando,
may anyone correct me if I'm wrong, but here is my idea:
Increasing jvm's memory will not directly help returning allocated memory. But a little JVM tuning can make the garbage collection via the Xms and Xmn parameters more efficient (look here for example: http://www.caucho.com/resin-3.0/performance/jvm-tuning.xtp).
The ARIS installation and administrationguide(unfortunatly only the german one) lists some hints on memory optimization within the scripting chapter:
Use database objects within the report only as long as necessary.
After this database objects should not be held in memory.
You can do this for example by following these measures:
- Keep no lists of ARIS objects in global Variables.
- With the help of "short" functions data is kept only as long as needed.
- It is advisable to empty lists containing many objects, if they are no longer needed.
Not really helpful in my opinion. Anyway, I don't know if the garbage collection is working properly for ARIS reports. It's supposed to return memory of an object if there is no reference to this object left(garbage collection by reference).
But there is something else you can try:
Use the delete operator for (global) lists of objects. There is only one problem: It is impossible to delete objects with the DontDelete-Attribute set, such as variable and function declarations in global and function code. So you have to use a little workaround to do so.
First of all: the delete operater returns true if the deletion was successful respectively false if the deletion failed. So here is an Example:
var globalModelList = new Array(); function main(){ var selectedGroups = ArisData.getSelectedGroups(); globalModelList = getModelsMatchingCertainCriteriaOutOf(selectedGroups); // DO SOMETHING WITH globalModellist delete selectedGroups; // false typeof(selectedGroups); // object } // other code main(); delete globalModelList; // false typeof(globalModelList); // object
What you have to do is setting variables explicitly as a an object's property. Look at the different use of selectedGroups in the following snippit:
var globalModelList = new Array(); function main(){ var localVariablesObject = new Object(); localVariablesObject.selectedGroups = ArisData.getSelectedGroups(); globalModelList = getModelsMatchingCertainCriteriaOutOf(localVariablesObject.selectedGroups); // DO SOMETHING WITH globalModellist delete localVariablesObject.selectedGroups; // true typeof(localVariablesObject.selectedGroups); // undefined } // other code main(); delete globalModelList; // false typeof(globalModelList); // object
Now can do the same with globalModelList, except that you don't have to create a variable object, because you already got one(this).
var GLOBAL_OBJECT = this; GLOBAL_OBJECT.globalModelList = new Array(); function main(){ var localVariablesObject = new Object(); localVariablesObject.selectedGroups = ArisData.getSelectedGroups(); globalModelList = getModelsMatchingCertainCriteriaOutOf(localVariablesObject.selectedGroups); // DO SOMETHING WITH globalModellist delete localVariablesObject.selectedGroups; // true typeof(localVariablesObject.selectedGroups); // undefined } // other code main(); delete globalModelList; // true typeof(globalModelList); // undefined
Let me know, if this is of any help to you.
Regards,
Maik