memory-leaks

Strange behavior in 'malloc_stats' function

限于喜欢 提交于 2020-05-15 05:39:09
问题 I'm doing some tests with 'malloc_stats' function and I've seen a strange behavior that I don't understand. The test is very easy, what I'm doing is allocate memory and print the 'malloc_stats' before the allocation, after the allocation and after free the memory. This is the code I'm using: int main(int argc, char *argv[]) { char *alloc[MAX_ALLOCS]; if ( argc < 3 or strcmp(argv[1], "--help") == 0 ) { cout << argv[0] << " num-blocks block-size [free-step [start-free [end-free]]]" << endl;

Guidelines to set MetaspaceSize - java 8

|▌冷眼眸甩不掉的悲伤 提交于 2020-05-14 17:54:08
问题 What is the default value of MetaspaceSize for 64-bit servers? I couldn't find it in the official documentation. I'm observing that in a server JVM process, at times, the GC frequency becomes high and keeps growing. If I restart the service a few times, it returns to stable. I think its due to the JRE upgrade. JVM Heap max size is set to be 6GB but when this problem occurs, we see only 3GB heap being used. Metaspace grows by very little and is almost always full. I tried increasing the

Guidelines to set MetaspaceSize - java 8

情到浓时终转凉″ 提交于 2020-05-14 17:53:45
问题 What is the default value of MetaspaceSize for 64-bit servers? I couldn't find it in the official documentation. I'm observing that in a server JVM process, at times, the GC frequency becomes high and keeps growing. If I restart the service a few times, it returns to stable. I think its due to the JRE upgrade. JVM Heap max size is set to be 6GB but when this problem occurs, we see only 3GB heap being used. Metaspace grows by very little and is almost always full. I tried increasing the

Do I need to unsubscribe from an Observable if the Observable is finished with?

纵然是瞬间 提交于 2020-05-14 05:56:29
问题 Let us say I have an Observable (hot, doesn't complete), and I subscribe to it. Ordinarily when I am finished with the Subscription I have to unsubscribe it to prevent memory leaks. let subject$ = new Subject(); const sub = subject$.subscribe(...); ... // Need to call sub.unsubscribe() when we are finished sub.unsubscribe(); sub = null; But if instead of just being finished with the Subscription I am also finished with the Observable ( Subject ) and I remove all reference to both, do I need

Why Aren't FormControl#valueChanges' Subscriptions Garbage Collected?

北城以北 提交于 2020-05-13 07:10:35
问题 I have gone through plenty of threads saying that one needs to unsubscribe from FormControl#valueChanges to prevent memory leaks. I understood the "when" and "how" to unsubscribe from Observable s. As I understand, Observables that produce infinite number of values need to be unsubscribed and FormControl#valueChanges is one such Observable . But my question is, why aren't these Observables s garbage collected? I mean when an Angular component gets destroyed, the references are dead right? The

Why Aren't FormControl#valueChanges' Subscriptions Garbage Collected?

心已入冬 提交于 2020-05-13 07:10:30
问题 I have gone through plenty of threads saying that one needs to unsubscribe from FormControl#valueChanges to prevent memory leaks. I understood the "when" and "how" to unsubscribe from Observable s. As I understand, Observables that produce infinite number of values need to be unsubscribed and FormControl#valueChanges is one such Observable . But my question is, why aren't these Observables s garbage collected? I mean when an Angular component gets destroyed, the references are dead right? The

Do I always need to call URL.revokeObjectURL() explicitly?

女生的网名这么多〃 提交于 2020-05-10 20:52:52
问题 I'm using blob to download files, Problem is I want to keep Object URL even after downloading the file, without making major changes in code base. So one of the option is not to call URL.revokeObjectURL(); Is it safe to depend on browser's garbage collector to avoid any memory leak? Do I always need to call URL.revokeObjectURL(); explicitly ? 回答1: Is it safe to depend on browser's garbage collector to avoid any memory leak? What createObjectURL approximately¹ does is to create a mapping of

Empty requestAnimationFrame loop leaking memory?

只愿长相守 提交于 2020-05-10 14:27:55
问题 I have a clean HTML file with requestAnimationFrame loop that does absolutely no processing. However, if I look at memory consumption on Chrome DevTools I see that used memory constantly increases and garbage collector runs every few seconds to collect around 1 megabyte of garbage data. So where does this memory leak comes from? That's how my memory usage looks like: And here's my code: <!DOCTYPE html> <html> <head lang="en"> <title></title> <script> function update() { window

Empty requestAnimationFrame loop leaking memory?

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-10 14:25:44
问题 I have a clean HTML file with requestAnimationFrame loop that does absolutely no processing. However, if I look at memory consumption on Chrome DevTools I see that used memory constantly increases and garbage collector runs every few seconds to collect around 1 megabyte of garbage data. So where does this memory leak comes from? That's how my memory usage looks like: And here's my code: <!DOCTYPE html> <html> <head lang="en"> <title></title> <script> function update() { window

Could Navigation Arch Component create a false positive memory leak?

£可爱£侵袭症+ 提交于 2020-05-10 07:28:06
问题 I have a basic knowledge of memory leaks and what can cause them. That's why I don't understand if I have a problem in my code or is it a false positive. I don't know which part of the code I should share since the project is not small. But just let me know in the comments and I will add required code. I use navigation arch component and follow MVVM pattern. I added LeakCanary library later in the development of project and it immediately started to give me warnings about retained instances