Properly clean up NetworkEventActors
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(Not tracked)
People
(Reporter: Honza, Unassigned)
References
(Blocks 2 open bugs)
Details
It looks like instances of NetworkEventActor are cleaned up only when the NetworkMonitorActor is destroyed. This might cause big memory footprint (and performance issues on destroy).
It would be better to clean up NetworkMonitorActors on every navigation (when persistent log is false) and also when the user is clearing the Network monitor panel.
See this code:
https://searchfox.org/mozilla-central/rev/a887c90ea9c19a0b5529a1f5fa351929944887ba/devtools/server/actors/network-monitor.js#204-214
Honza
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Comment 1•6 years ago
•
|
||
I added a simple log into the aforementioned method and it shows that the this._netEvents
map is cleared only when closing the entire Toolbox. So, reloads (with Persist Logs == false) are only adding new actors into it (not removing). Clearing Network panel content has also no effect on that array.
Honza
diff --git a/devtools/server/actors/network-monitor.js b/devtools/server/actors/network-monitor.js
--- a/devtools/server/actors/network-monitor.js
+++ b/devtools/server/actors/network-monitor.js
@@ -196,16 +196,18 @@ const NetworkMonitorActor = ActorClassWi
const actor = this.getNetworkEventActor(data.channelId);
this.messageManager.sendAsyncMessage("debug:get-network-event-actor:response", {
channelId: data.channelId,
actor: actor.form(),
});
},
getNetworkEventActor(channelId) {
+ console.log("getNetworkEventActor " + channelId + ", " + this._netEvents.size);
+
let actor = this._netEvents.get(channelId);
if (actor) {
return actor;
}
actor = new NetworkEventActor(this);
this.manage(actor);
Updated•6 years ago
|
Updated•4 years ago
|
Description
•