Closed Bug 787929 Opened 12 years ago Closed 12 years ago

JavaScript: The delete operator creates a memory leak.

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: djlexs, Unassigned)

Details

Attachments

(2 files)

In some cases, the operator delete, create a memory leak. In the attached file contains a short code leak.
JavaScript is a feature or a bug yet?
And if a little restructure data leakage will not.
The case of the diversion structure is as follows:
testedObject = {
    item_1 : {
        obj : {....}
    },
    item_2 : ...
    ....
    .....
}

delete testedObject[ 'item_' + i ].obj;

The case where there is no leakage:
testedObject = {
    obj : {
        item_1 : {....},
        item_2 : ...
          ....
          .....
    }
}

delete testedObject.obj[ 'item_' + i ];
Attached file File no leakage
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
Where are you seeing the memory leak?

When you delete different properties on different objects, they can no longer share property information, so they get unique property descriptors.  So you would expect to see more memory usage.  But what exactly makes you think this is a leak?
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: