memory-leaks

FileReader memory leak in Chrome

徘徊边缘 提交于 2021-02-07 03:49:40
问题 I have a webpage with file upload functionality. The upload is performed in 5MB chunks. I want to calculate hash for each chunk before sending it to the server. The chunks are represented by Blob objects. In order to calculate the hash I am reading such blob into an ArrayBuffer using a native FileReader. Here is the code: var reader = new FileReader(); var getHash = function (blob, callback) { reader.onloadend = function (e) { var hash = util.hash(e.target.result); callback(hash); }; reader

Android memory leak with static final

谁说胖子不能爱 提交于 2021-02-07 03:49:34
问题 The question is on using static final constants which apparently causes memory leaks: I have been searching for information on how not to cause memory leaks in Android Apps. One big problem is using private static final for constants. Apparently that is how constants should be defined. But static final means it hangs around after a rotation and means the Activity cannot be cleared. Obviously I am misunderstanding something. I know that putting variables in the Application context allows them

FileReader memory leak in Chrome

别来无恙 提交于 2021-02-07 03:49:26
问题 I have a webpage with file upload functionality. The upload is performed in 5MB chunks. I want to calculate hash for each chunk before sending it to the server. The chunks are represented by Blob objects. In order to calculate the hash I am reading such blob into an ArrayBuffer using a native FileReader. Here is the code: var reader = new FileReader(); var getHash = function (blob, callback) { reader.onloadend = function (e) { var hash = util.hash(e.target.result); callback(hash); }; reader

How to debug Azure Web App memory leaks?

爱⌒轻易说出口 提交于 2021-02-06 20:06:46
问题 There is the excellent Start Profiling button in the SCM portal that works perfect for CPU. Then there are some sources that refer to a Download GC Dump button: https://stackoverflow.com/a/27987593/647845 But that doesn't seem to be available anymore. Then there is the Download memory dump button. But for now I can't figure out how/if I can see the Type / Refcount / Size stastistics that I'm used too. What is the recommended way to look for memory leaks in a C# Azure Web App? 回答1: Try using

Valgrind shows memory leaks from ncurses commands after using appropriate free() and end()

南楼画角 提交于 2021-02-05 09:12:14
问题 I have a program I'm writing to better understand ncurses, and when I push it through valgrind , it outputs many leaks associated with ncurses commands. However, I only use stdscr , and call endwin() at the end of main() . I have user options set by using menu.h, and use free_item and free_menu at the end: menuChoice(WINDOW* scr, std::vector<std::string> *choices, std::string desc) { //create the menu and the item pointer vector MENU* my_menu; std::vector<ITEM*> my_items; ITEM* cur = NULL;

Valgrind shows memory leaks from ncurses commands after using appropriate free() and end()

做~自己de王妃 提交于 2021-02-05 09:12:03
问题 I have a program I'm writing to better understand ncurses, and when I push it through valgrind , it outputs many leaks associated with ncurses commands. However, I only use stdscr , and call endwin() at the end of main() . I have user options set by using menu.h, and use free_item and free_menu at the end: menuChoice(WINDOW* scr, std::vector<std::string> *choices, std::string desc) { //create the menu and the item pointer vector MENU* my_menu; std::vector<ITEM*> my_items; ITEM* cur = NULL;

Memory leak, does window have a safeguard to prevent max memory reached?

淺唱寂寞╮ 提交于 2021-02-05 08:22:27
问题 I have an application that uses a 3rd party API and I think they are having a memory leak issue. I wrote a small test program (below) to test this out, please note, both VMIListener and VMI are from the APIs in which I'm implementing their virtual interface methods. I don't have any memory leak behavior if I comment out the VMI vmi; under my VMITest class. With my limited knowledge in C++ I assume this is because the virtual VMI class does not have the virtual destructor. However, my question

PM2 - Incorrect memory usage reading & possible memory leak with Node.js application

别等时光非礼了梦想. 提交于 2021-02-05 06:21:09
问题 When my node js server is running via pm2, it has a higher memory usage reading than the actual memory heap in the application when inspected in DevTools. More so, the value under memory in pm2 slowly increases over time, possibly indicating some kind of memory leak. This slow increase in memory usage also cannot be observed in DevTools. Any explanation and/or solutions to these two (seemingly) strange occurrences? This is my DevTools This is pm2 list here is my javascript code var SSE =

Is my valgrind installation broken?

柔情痞子 提交于 2021-02-04 08:17:45
问题 I have this basic Hello World code : #include <stdio.h> int main() {printf("Hello World !"); return 0;} Then valgrind return me this summary : HEAP SUMMARY: ==17840== in use at exit: 22,114 bytes in 160 blocks ==17840== total heap usage: 176 allocs, 16 frees, 28,258 bytes allocated ==17840== ==17840== LEAK SUMMARY: ==17840== definitely lost: 7,960 bytes in 63 blocks ==17840== indirectly lost: 6,888 bytes in 8 blocks ==17840== possibly lost: 72 bytes in 3 blocks ==17840== still reachable: 32

OpenCL clCreateContextFromType function results in memory leaks

限于喜欢 提交于 2021-01-29 18:39:50
问题 I ran valgrind to one of my open-source OpenCL codes (https://github.com/fangq/mmc), and it detected a lot of memory leaks in the OpenCL host code. Most of those pointed back to the line where I created the context object using clCreateContextFromType . I double checked all my OpenCL variables, command queues, kernels and programs, and made sure that they are all properly released, but still, when testing on sample programs, every call to the mmc_run_cl() function bumps up memory by 300MB