memory-leaks

Android Surfaceview Threads and memory leaks

扶醉桌前 提交于 2019-12-31 14:45:57
问题 Im creating a game in android, and i noticed that the game has a memory leak. Iv managed to isolate the memory leak into a smaller application so that i can see well try and work out, how to fix it. The application uses a surfaceview for its view and has a thread attached to that in order to do all the drawing to the screen. The memory leak happens when i start a new activity and close the one that im currently using. I can see this when i do a memory dump on my test application as all it

Memory leak in Node.js scraper

∥☆過路亽.° 提交于 2019-12-31 13:52:13
问题 This is a simple scraper written in JavaScript with Node.js, for scraping Wikipedia for periodic table element data. The dependencies are jsdom for DOM manipulation and chain-gang for queuing. It works fine, most of the time (it doesn't handle errors gracefully), and the code isn't too bad, dare I say for a for attempt, but there is a serious fault with it - it leaks memory horribly, anywhere from 0.3% to 0.6% of the computer's memory for each element, such that by the time it gets to lead it

Memory leak in Node.js scraper

懵懂的女人 提交于 2019-12-31 13:52:10
问题 This is a simple scraper written in JavaScript with Node.js, for scraping Wikipedia for periodic table element data. The dependencies are jsdom for DOM manipulation and chain-gang for queuing. It works fine, most of the time (it doesn't handle errors gracefully), and the code isn't too bad, dare I say for a for attempt, but there is a serious fault with it - it leaks memory horribly, anywhere from 0.3% to 0.6% of the computer's memory for each element, such that by the time it gets to lead it

JQuery Garbage Collection - Will This Be Clean?

女生的网名这么多〃 提交于 2019-12-31 12:52:12
问题 Many articles (e.g. msdn) have said that a circular reference cannot be cleaned up in some browsers when it involves a DOM object and a JS object. (IE 6 can't do it at all and IE7 can only do it between page requests): Javascript Native ( Leaks ): function leak(){ var elem = document.createElement("DIV"); document.body.appendChild(elem); elem.onclick = function () { elem.innerHTML = elem.innerHTML + "."; // ... }; } Because the element's onload property refers back to itself through a closure

Burst memory usage in Java

旧巷老猫 提交于 2019-12-31 11:41:01
问题 I am trying to get a handle on proper memory usage and garbage collection in Java. I'm not a novice programmer by any means, but it always seems to me that once Java touches some memory, it will never be released for other applications to use. In that case, you have to make sure your peak memory is never too high, or your application will continually use whatever the peak memory usage was. I wrote a small sample program trying to demonstrate this. It basically has 4 buttons... Fill class

Memory leak in JavaScript (Chrome)

本小妞迷上赌 提交于 2019-12-31 10:48:11
问题 I'm calling a function 50 times a second, which does some expensive things as it is painting alot on a <canvas> element. It works great, no problems there, but I just took a look at the memory usage and it was stealing 1MB a second of my RAM. Chrome seems to garbage collect, as it went down each minute or so, but then the usage grew again. What I tried is putting return at certain places in my function so as to decide what part of my function exactly causes the leak. I've been able to cut it

How to use Leak Canary

倖福魔咒の 提交于 2019-12-31 09:11:34
问题 I know this is probably a dumb question, but I am pretty new at developing android, and I currently experiencing an OutOfMemoryError in my apps, which I have tried to debug using MAT, but it is still too hard to find the leak in a few activities, then I found LeakCanary, which seems simpler and easier to use, however I could not find any beginner step by step guide on using Leak Canary, even on Google. I have installed LeakCanary through the dependencies in my build.gradle, and this is what I

NSURLSession Memory Leaks occur when using web services in IOS

老子叫甜甜 提交于 2019-12-31 09:00:09
问题 I am building an app that uses a web service and to get information from that web service I use NSURLSession and NSURLSessionDataTask . I am now in the memory testing phase and I have found that NSURLSession is causing memory leaks. This is not all of the leaks. It is all that I could fit in the picture. Below is how I setup the NSURLSession and request the information from the web service. #pragma mark - Getter Methods - (NSURLSessionConfiguration *)sessionConfiguration { if (

Why is PermGen space growing?

删除回忆录丶 提交于 2019-12-31 08:52:29
问题 I've read a few articles, and I understood the following (please correct me and/or edit the question if I'm wrong): The java heap is segmented like this: Young Generation: objects that are created go here, this part is frequently and inexpensively garbage collected Old Generation: objects that survive the garbage collections of the Young generation go here, this area is garbage collected less frequently and using a more CPU demanding process/algorithm (I believe it's called mark-sweep) Edit:

Swift Struct Memory Leak

≯℡__Kan透↙ 提交于 2019-12-31 08:13:27
问题 We're trying to use Swift structs where we can. We are also using RxSwift which has methods which take closures. When we have a struct that creates a closure that refers to self , that creates a strong reference cycle. import Foundation import RxSwift struct DoesItLeak { var someState: String = "initial value" var someVariable: Variable<String> = Variable("some stuff") let bag = DisposeBag() mutating func someFoo() { someVariable.subscribeNext { person in self.someState = "something" }