Closed
Bug 1227914
Opened 9 years ago
Closed 9 years ago
Limit memory usage of TraceLogger ContinuousSpace
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: h4writer, Assigned: h4writer)
References
Details
Attachments
(1 file)
1.49 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
Currently when there is not enough space in the ContinuousSpace, we will just double the about the memory used. Upon fail, we write/drop the data and reuse the memory we already had. Now it might be good to have some upper-limit that the ContinuousSpace can use. Just for safety.
Assignee | ||
Comment 1•9 years ago
|
||
Put an upperbound on how big ContinuousSpace can get. Went for 200MB. Just to make sure we don't take all memory.
Assignee: nobody → hv1989
Attachment #8691922 -
Flags: review?(benj)
Comment 2•9 years ago
|
||
Comment on attachment 8691922 [details] [diff] [review] Patch Review of attachment 8691922 [details] [diff] [review]: ----------------------------------------------------------------- r=me if you're fine with the change below, which makes things easier to understand imo. ::: js/src/vm/TraceLoggingTypes.h @@ +204,5 @@ > + if (nCapacity * sizeof(T) > CONTINUOUSSPACE_LIMIT) { > + if ((size_ + count) * sizeof(T) > CONTINUOUSSPACE_LIMIT) > + return false; > + nCapacity = size_ + count; > + } It took me some time to realize why this is correct. Instead, can you do: uint32_t nCapacity = capacity_ * 2; if (size_ + count > nCapacity || nCapacity * sizeof(T) > CONTINUOUSSPACE_LIMIT) nCapacity = size_ + count; if (nCapacity * sizeof(T) > CONTINUOUSSPACE_LIMIT) return false;
Attachment #8691922 -
Flags: review?(benj) → review+
Comment 3•9 years ago
|
||
Or even uint32_t nCapacity = capacity_ * 2; if (size_ + count > nCapacity || nCapacity * sizeof(T) > CONTINUOUSSPACE_LIMIT) { nCapacity = size_ + count; if (nCapacity * sizeof(T) > CONTINUOUSSPACE_LIMIT) return false; }
Comment 5•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/541a97a551cb
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•