History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4688
Type: Bug Bug
Status: Open Open
Priority: P2 P2
Assignee: P T Withington
Reporter: André Bargull
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

LzDatapointer / LzDatapath leak memory

Created: 09/Sep/07 04:06 AM   Updated: 30/Jun/08 01:18 PM
Component/s: LFC - Data
Affects Version/s: 4.0.3, 4.0.5WaffleCone
Fix Version/s: Eclair (4.3)

Time Tracking:
Not Specified

File Attachments: 1. File LPP-4688.lzx (4 kb)


Severity: Major
Runtime: N/A
Fix in hand: False


 Description  « Hide
LzDatapointer, LzDatapath and co. leak memory, because there is no update of their "context"- and "__LZtracking"-member when the referenced datasets has been destroyed.

To minimize this memory-leak, we should clear out the "childNodes"-member of LzDataset in the "destroy"-method of LzDataset by calling "setChildNodes([ ]).
This approach of setting "childNodes" to an empty Array has got the advantage of updating any data-bound view, compared with simply setting "this.childNodes=null".


Still open:
- Even if the proposed approach minimizes leakage, it does not completely provide a mechanism to stop this misconception! => What about creating a handler to the "ondestroy"-event of the context (if it is an instance of LzDataset), so we can clear the leaking members? This should solve this memory-leak issue.

- How to rebind datapaths? => whenever a new datasets with the same name has been created, how shell we handle databinding?

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
André Bargull - 09/Sep/07 04:35 AM
Attached testcase "LPP-4688.lzx"

Henry Minsky - 16/Nov/07 11:36 AM
Regarding your last question, what to do if a new dataset with the same name is created. We currently issue a warning when this occurs, so I guess we aren't really supporting replacing a named dataset with a new one. The data can be reloaded of course, but I don't think there is any good mechanism to automatically notify all the nodes which already point to
a dataset that they need to point to a different instance.


P T Withington - 10/Jan/08 12:05 PM
Change 20071121-hqm-8 by hqm@IBM-2E06404CB67 on 2007-11-21 12:47:42 EST
    in /cygdrive/c/users/hqm/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: clear childNodes array when destroying an LzDataset

New Features:

Bugs Fixed: LPP-4688

Technical Reviewer: andre
QA Reviewer: pbr
Doc Reviewer:

Documentation:

Release Notes:

Details:
    
This addresses one of the issues in the bug report, but does not address
adding any delegates to listen for an 'ondestroy' event to allow references
from other nodes to be nulled out.


Tests:

smokecheck
lfc/data/alldata.lzx


André Bargull - 10/Jan/08 02:36 PM
We also need to clear the "LzDataset#data" field in "LzDataset#destroy(..)" to reduce mem-leaks.