this will help I have some questions for below codes ! Do I need to release mConnectEnv, s_jObj, jmethodConnect ? Following my infos that I searched in google. I don't need to release jmethodConnect, how about mConnectEnv and s_jObj ? Therefore when I release j_ip, I used deleteLocalRef, I think this way is wrong! Should I use the ReleaseStringUTF method ? , Do I need to release mConnectEnv, s_jObj, jmethodConnect ?
I think the issue was by ths following , You need to free the bytes, because NSData does not take ownership of it: it cannot know if the array is a temporary or a dynamic, so it makes a copy of it. To fix this problem, replace
To fix this issue I was not able to pinpoint the source of the memory leak but it definitely comes from the runtime. Changing the "Runtime Library" in the project options from "Multi-threaded DLL (/MD)" to "Multi-threaded Debug DLL (/MDd)" eliminates the memory leak.
window closed event doesn't release memory and resource. How to solve the memory leak in WPF?