Monitoring System Resources Usage

Description:This example explains how make sure dynamically created Visual LANSA objects do not exhaust system resources.
Support:Supplied on an as-is basis
Environment:Visual LANSA
Details:As your Visual LANSA applications become more sophisticated you need to be mindful when dynamically creating Visual LANSA objects. Typically a Visual LANSA object is dynamically created using commands like this:

Set_Ref #SomeReference To(*Create_As #SomeClassName)
Set_Ref #SomeReference To(*Create_From #VaribleContainingClassName)

If you do this type of thing in your Visual LANSA you may find this example useful.

Why might you need to know this?
A Visual LANSA application may exhaust a computer resource (e.g. memory, system handles) because your application code is dynamically creating many Visual LANSA objects, but failing to destroy them when they are no longer needed. In some cases you may even think you are destroying dynamically created objects, but unless you have actually tested this, you may find that subtle issues in your design or code is preventing this and causing resource leakage.

This example demonstrates and explains:
  • Why a simple object create/destroy scenario works.
  • Why a similar simple object create/destroy scenario does not work.
  • A simple technique to test that your create/destroy approach works.
  • A simple technique to identify objects being leaked by your design.
Disclaimer:Contributors to the LANSA Tech Exchange are responsible for the correctness of any Components (code and documentation) that they submit. Contributors are also responsible for any support that might be offered with any Components they submit. LANSA does not provide any warranty concerning fitness for purpose nor correctness of any Component submitted to the Exchange. LANSA does not provide any warranty for any ongoing support offered for Components submitted by any party to the Exchange.

Users of the Exchange who download any Component do so with the express understanding and agreement of the foregoing disclaimers.
Example:Example screen
Back to Top