memory-leaks

Setting img.src to dataUrl Leaks Memory

走远了吗. 提交于 2019-12-21 04:11:37
问题 Below I've created a simple test case that shows that when an img tag's src is set to different dataUrls, it leaks memory. It looks like the image data is never unloaded after the src is changed to something else. <!DOCTYPE html> <html> <head> <title>Leak Test</title> <script type="text/javascript"> canvas = null; context = null; image = null; onLoad = function(event) { canvas = document.getElementById('canvas'); context = canvas.getContext('2d'); image = document.getElementById('image');

Cannot allocate memory: fork: Unable to fork new process?

◇◆丶佛笑我妖孽 提交于 2019-12-21 03:46:24
问题 We have our hosting in aws . Recently after moving our blog from wordpress to aws , we are experiencing noticeable delay in server response time. Mainly while accessing the blog. Below are the logs from the error_log file, [Wed Feb 25 06:10:10 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process [Wed Feb 25 06:12:22 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process [Wed Feb 25 06:12:36 2015] [error] (12)Cannot allocate memory: fork: Unable to

Tracking Down a .NET Windows Service Memory Leak

半世苍凉 提交于 2019-12-21 03:44:17
问题 Before installing my windows service in production, I was looking for reliable tests that I can perform to make sure my code doesn't contain memory leaks. However, All what I can find on the net was using task manager to look at used memory or some paid memory profiler tools. From my understanding, looking at the task manager is not really helpful and cannot confirm the memory leakage (in case, there is). How to confirm whether there is a memory leak or not? Is there any free tools to find

How to obtain the names of custom-made structures whose instances have leaked memory?

て烟熏妆下的殇ゞ 提交于 2019-12-21 03:32:31
问题 I am working a on parser which will go through a FASTMM4 memory leak report and store all relevant data in a custom-made structure/class. I use VirtualTreeView to display each class that has leaked instances as a node in the tree. The tree - Notice that the FIRST node says unknown. This is because FASTMM calls a method AClass to determine weather it is a class or not. When it finds custom structures, it marks them as unknown, which doesn't make my report analyzer very effective since most

addEventListener memory leaks

我只是一个虾纸丫 提交于 2019-12-20 20:40:14
问题 When registering an event via addEventListener on an element, then delete that element without removing the event, and doing so repeatedly, would memory be "leaked"? 回答1: It shouldn't leak. The one browser that's infamous for leaking like hell when an event handler causes a host-object<>JS-object loop is IE (up to version 7), and IE (up to version 8) doesn't support addEventListener . Leave this running and see how the browser's memory usage is affected in the long term, if you want to test

.NET RegEx “Memory Leak” investigation

核能气质少年 提交于 2019-12-20 19:35:39
问题 I recently looked into some .NET "memory leaks" (i.e. unexpected, lingering GC rooted objects) in a WinForms app. After loading and then closing a huge report, the memory usage did not drop as expected even after a couple of gen2 collections. Assuming that the reporting control was being kept alive by a stray event handler I cracked open WinDbg to see what was happening... Using WinDbg, the !dumpheap -stat command reported a large amount of memory was consumed by string instances. Further

does jQuery .html() method leak memory?

孤街醉人 提交于 2019-12-20 18:14:14
问题 I am building a game with a requestAnimationFrame loop that includes a call to jQuery html() method. It just updates the text in a status window next to the game action. I notice with Chrome's timeline monitor, that the DOM nodes go up and up and up, thousands in a minute! And when I change my code from: // creates a ton of DOM nodes $("#readout").html(data); to // DOM nodes does not increase over time document.getElementById('readout').innerHTML = data; the 'memory leak' goes away. 回答1:

C++: is push_back(new Object()) a memory leak?

别来无恙 提交于 2019-12-20 18:09:10
问题 Is the following C++ code a memory leak? list.push_back(new String("hi")); As I understand it, push_back from any std collection/container always makes a copy. So if the new string is copied, nothing can ever delete the new'd string right? since there is no reference to it after the push_back... Am I correct or wrong here? Thanks. Jbu edit: I think I am wrong, since new will return a pointer...we'll always have the pointer to be able to delete the new String 回答1: No, the vector stores

Does a javascript event handler exist in memory even after the DOM element to which it is bound is removed?

末鹿安然 提交于 2019-12-20 12:35:09
问题 Given the following code <div id="app"> <div id="foo" /> </div> <script> $('#foo').bind('click', function(){}); </script> I plan on replacing the contents of #app [e.g. $('#app').html('...'); , or innerHTML = '...'; ]. I know that I can use jQuery's .remove() which calls a 'destroy' handler that unbinds events. The fact that there is a destroy handler set up to remove events leads me to believe that without unbinding the events, when the DOM element is removed, the handler will still exist in

G++ Multi-platform memory leak detection tool

感情迁移 提交于 2019-12-20 12:26:59
问题 Does anyone know where I can find a memory memory leak detection tool for C++ which can be either run in a command line or as an Eclipse plug-in in Windows and Linux. I would like it to be easy to use. Preferably one that doesn't overwrite new(), delete(), malloc() or free(). Something like GDB if its gonna be in the command line, but I don't remember that being used for detecting memory leaks. If there is a unit testing framework which does this automatically, that would be great. This