Skip to content

Conversation

@srawlins
Copy link
Contributor

Work towards #9489

In this PR, we change the behavior of navigating away from the Network screen. Previously, any time the user navigates away, we stop recording. This has been determined to be surprising behavior. Instead we can continue recording while the user is away.

We can make other UX changes to make it obvious whether network requests are being logged or not. I'll do that in a separate CL.

@srawlins srawlins requested a review from a team as a code owner October 26, 2025 22:32
}

@override
void dispose() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is dispose() actively called when we switch screens now? I seem to recall the network profiler continuing to work after navigating away from the network screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was the mechanism for the network controller to stop recording, so something is calling it. I didn't look to see where.

@elliette
Copy link
Member

I'm concerned that this might have some performance costs if a user navigates away from the network panel without pausing the recording and then never navigates back to stop recording. Do we know what the performance implications here are?

@elliette
Copy link
Member

We can make other UX changes to make it obvious whether network requests are being logged or not. I'll do that in a separate CL.

One thing to note here is that when DevTools is embedded in an IDE, we don't display the tab headers:
Screenshot 2025-10-27 at 9 25 29 AM

@srawlins
Copy link
Contributor Author

I'm concerned that this might have some performance costs if a user navigates away from the network panel without pausing the recording and then never navigates back to stop recording. Do we know what the performance implications here are?

Good question. I can look into how much memory creeps up with a thousand network requests or something. Both of DevTools and the app-under-test.

@srawlins
Copy link
Contributor Author

I found that it uses a surprising amount of memory!

After repeatedly sending very small POST requests, which receive very simple responses, I see that 3000 requests resulted in 1.4GB additional RSS! That's 500k / request, which seems... bonkers. Nevertheless, storing many logged requests does increase memory use significantly.

@bkonyi I don't think there is a mechanism to remove "stale" logged network request data, is there? Meaning, whenever we click "Clear" in the DevTools Network screen, we could send a VM service message to throw away all existing logged data.

@bkonyi
Copy link
Contributor

bkonyi commented Oct 29, 2025

I found that it uses a surprising amount of memory!

After repeatedly sending very small POST requests, which receive very simple responses, I see that 3000 requests resulted in 1.4GB additional RSS! That's 500k / request, which seems... bonkers. Nevertheless, storing many logged requests does increase memory use significantly.

That sounds excessive! I'd be interested to see what's causing that much memory to be used.

@bkonyi I don't think there is a mechanism to remove "stale" logged network request data, is there? Meaning, whenever we click "Clear" in the DevTools Network screen, we could send a VM service message to throw away all existing logged data.

I think this is what you're looking for 😄

https://pub.dev/documentation/vm_service/latest/vm_service/DartIOExtension/clearHttpProfile.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants