.NET android memory leak issues

Vaka Gopi 0 Reputation points
2024-11-09T13:02:38.1966667+00:00

In our Android app, We are facing memory leak issue. so we tried with simple Lable. But issue remains same. Please find below details for leak information.

//////////////////////////////////////////////////////////

┬─── │ GC Root: Global variable in native code │ ╰→ android.widget.LinearLayout instance      Leaking: YES (ObjectWatcher was watching this because      crc641149b9fe658fbe8e.CustomFragment received Fragment#onDestroyView()      callback (references to its views should be cleared to prevent leaks) and      View.mContext references a destroyed activity)      Retaining 2.2 kB in 44 objects      key = 61478e55-e8c2-4719-831c-ac8c548c4bac      watchDurationMillis = 19909      retainedDurationMillis = 11081      View not part of a window view hierarchy      View.mAttachInfo is null (view detached)      View.mWindowAttachCount = 1      mContext instance of crc641149b9fe658fbe8e.MapActivity with mDestroyed =      true

 

METADATA

 

Build.VERSION.SDK_INT: 34 Build.MANUFACTURER: Google LeakCanary version: 2.10 App process name: com.companyname.AndroidApp2 Class count: 29018 Instance count: 213300 Primitive array count: 154111 Object array count: 31403 Thread count: 29 Heap total bytes: 29178006 Bitmap count: 8 Bitmap total bytes: 222790 Large bitmap count: 0 Large bitmap total bytes: 0 Db 1: open /data/user/0/com.companyname.AndroidApp2/databases/com.microsoft. appcenter.persistence Db 2: open /data/user/0/com.companyname.AndroidApp2/databases/leaks.db Stats: LruCache[maxSize=3000,hits=116427,misses=201971,hitRate=36%] RandomAccess[bytes=9958639,reads=201971,travel=81094436772,range=35128630,size=4 4047340] Analysis duration: 11694 ms

////////////////////////////////////////////////////////////

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,924 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,603 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.