maui icon indicating copy to clipboard operation
maui copied to clipboard

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

Open danardelean opened this issue 1 year ago • 4 comments

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 avatar Jan 26 '24 18:01 danardelean

image

danardelean avatar Jan 26 '24 18:01 danardelean

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

danardelean avatar Jan 26 '24 18:01 danardelean

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.

verthal avatar Feb 20 '24 07:02 verthal

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

danardelean avatar Feb 20 '24 17:02 danardelean

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

AStrickland-abbott avatar Mar 21 '24 13:03 AStrickland-abbott

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

Zhanglirong-Winnie avatar May 23 '24 09:05 Zhanglirong-Winnie