Skip to content
Menu
Menu

Knowledge Base

KB050048 | MEMORY LEAK DUE TO ERRORS IN YOUR GLOBAL SCRIPT

KB050048 | MEMORY LEAK DUE TO ERRORS IN YOUR GLOBAL SCRIPT

Product: Elvis
Booth: 2003-09-17

Symptoms

Error information about your calculations in the global script causes about 40 bytes of memory leakage.

Cause

Errors in the global scrip can be detected in the log file. The fact that errors occur from time to time during the execution of the global script is not a big deal at first, but Basic writes information about the error into memory every time. Unfortunately, this information is not automatically released again (approx. 40 bytes per error).
For data point calculations, where a “real” basic function is created from the specified formula at runtime anyway, Elvis 2.1 inserts appropriate code to release the information. This does not work in the global script, since the complete function is written by you.

Solution

You can easily add an appropriate error handling yourself.
At the beginning of the OnDatapointChanged or OnInit function, insert the following code (download here):

On Error Goto ErrorHandler
If False Then ErrorHandler:
	Print "Error in OnDatapointChanged: ", Err.Number, Err.Description
	Err.Clear
	Exit Sub
End If

In the event of an error in the function, the jump label ErrorHandler is activated, which writes the information to the log file, releases the error information and aborts the function. The “If False Then” is used to ensure that the error code is not executed normally.

Support Area

KB050048 | MEMORY LEAK DUE TO ERRORS IN YOUR GLOBAL SCRIPT

Knowledge Base

Here you will find answers, solutions to problems and examples of our products.
KB050048 | MEMORY LEAK DUE TO ERRORS IN YOUR GLOBAL SCRIPT

Case Studies

Successful in use: practical examples of our products and individual developments.
KB050048 | MEMORY LEAK DUE TO ERRORS IN YOUR GLOBAL SCRIPT

Support

Describe your concern using our support form.
KB050048 | MEMORY LEAK DUE TO ERRORS IN YOUR GLOBAL SCRIPT

License registration

Register your Elvis license!

IT GmbH · An der Kaufleite 12 · D-90562 Kalchreuth

© Copyright 2024. IT GmbH | Webdesign by Appear Online