JavaScript: The delete operator creates a memory leak.

RESOLVED INVALID

Status

()

Core
JavaScript Engine
RESOLVED INVALID
6 years ago
6 years ago

People

(Reporter: Geverges Oleg, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
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 ];
(Reporter)

Comment 1

6 years ago
Created attachment 657852 [details]
File containing the leak.
(Reporter)

Comment 2

6 years ago
Created attachment 657854 [details]
File no leakage

Updated

6 years ago
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?
(Reporter)

Updated

6 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.