dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

Xcode Instruments Memory Allocations does not work with .NET MAUI projects on iOS #20185

Open danardelean opened 8 months ago

danardelean commented 8 months ago

Description

Debbuging native memory allocations on iOS with Instruments doesn't work for MAUI projects

Steps to Reproduce

  1. Create an .Net MAUI application and deploy on an iOS emulator
  2. Try do debug Memory allocations with Instruments The application will run the tool will register a few seconds and then stop
  3. If you use a "pure" net8.0-ios project Instruments will not stop tracing the memory allocations

Link to public reproduction project repository

No response

Version with bug

8.0.6

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

danardelean commented 8 months ago

image

danardelean commented 8 months ago

This works for an Net8.0-ios application: image

verthal commented 7 months ago

hi, same problem here. We want to use Instruments to trace memory allocations, that are not recorded by dotnet-gcdump or dotnet-trace. It was possible to use Instruments with Xamarin.Forms Apps, but with .Net 8-Maui it doesn't work anymore.

danardelean commented 7 months ago

It would be nice to have some kind of feedback from the team not only adding labels

AStrickland-abbott commented 6 months ago

I see a similar behavior. If I do new Net-iOS project, the profiler records the whole session. If I try to run on our actual Net-iOS app, which uses Maui Essentials and shared project structure, it only attaches for 2-4 seconds before stopping. Running 8.0.203 of dotnet, Maui Essentials 8.0.6 and CommunityToolkit.Mvvm 8.2.2

Zhanglirong-Winnie commented 4 months ago

Verified this issue with Visual Studio 17.6.12(Build410)and Xcode Instruments (15.1). Can repro this issue. image

danardelean commented 1 month ago

Would be really nice to have more feedback on this issue.