Memo Rodriguez
2018-06-01 18:05:49 UTC
hi
I want to start using the new memory debugging tools that were introduced
with the ndk toolchain. I've been looking into how to use the malloc debug
in combination with the wrap shell script. I've created a simple toy
example that allocates 1MB without freeing the memory but unfortunately I
haven't been able to see the leak being reported in my adb logs.
extern "C"
JNIEXPORT jstring
JNICALL
Java_android_apple_com_memorydebuggingtest_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello = "Hello from C++";
char* ptr = (char*) malloc(1024 * 1024 * sizeof(char*));
ptr = nullptr;
return env->NewStringUTF(hello.c_str());
}
I'm using a non-rooted pixel 2 with android 8.1, the documentation doesn't
mentioned that the device should be rooted. Can you guys confirm?, do you
guys have any toy examples that could enforce and report a leak?
thx
Memo
I want to start using the new memory debugging tools that were introduced
with the ndk toolchain. I've been looking into how to use the malloc debug
in combination with the wrap shell script. I've created a simple toy
example that allocates 1MB without freeing the memory but unfortunately I
haven't been able to see the leak being reported in my adb logs.
extern "C"
JNIEXPORT jstring
JNICALL
Java_android_apple_com_memorydebuggingtest_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello = "Hello from C++";
char* ptr = (char*) malloc(1024 * 1024 * sizeof(char*));
ptr = nullptr;
return env->NewStringUTF(hello.c_str());
}
I'm using a non-rooted pixel 2 with android 8.1, the documentation doesn't
mentioned that the device should be rooted. Can you guys confirm?, do you
guys have any toy examples that could enforce and report a leak?
thx
Memo
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.