memory-leaks

Swift memory leak when iterating array of Errors

て烟熏妆下的殇ゞ 提交于 2019-12-24 00:46:29
问题 I'm relatively new to Swift, so I hope I'm not asking a stupid question. I have some code that instantiates an array of type Error , which will later be iterated and printed to the console. When running this code through Instruments using the "Leaks" instrument, it shows a leak of _SwiftNativeNSError . If I change the array type from [Error] to [Any] , the leak disappears, even though it is still actually holding an object conforming to Error . The leak is not reproducible with any other data

jQuery - Internet Explorer memory leaks

一世执手 提交于 2019-12-24 00:32:55
问题 I'm developing an internal web application for use on the helpdesk on which I work, designed to be run fullscreen, all the time, on large TVs around the room, displaying relevant data for the guys taking calls. We're using Internet Explorer 8 on Windows 7 (company security policy doesn't allow for any other browser) and jQuery 1.6.2 . All the scripts and data are stored on the LAN - nothing's coming off the internet. Essentially the application queries several XML files (generated by server

Memory leak in adding list values

为君一笑 提交于 2019-12-24 00:28:31
问题 i'm new to python and have big memory issue. my script runs 24/7 and each day it allocates about 1gb more of my memory. i could narrow it down to this function: Code: #!/usr/bin/env python # coding: utf8 import gc from pympler import muppy from pympler import summary from pympler import tracker v_list = [{ 'url_base' : 'http://www.immoscout24.de', 'url_before_page' : '/Suche/S-T/P-', 'url_after_page' : '/Wohnung-Kauf/Hamburg/Hamburg/-/-/50,00-/EURO--500000,00?pagerReporting=true',}] # returns

Memory leak with Timer

岁酱吖の 提交于 2019-12-24 00:23:03
问题 I am using a timer that is canceled and restarted on a listener event. It all works fine except that the the timer thread leaks the whole outer class. My timer implementation is as follows: if(timer != null) { timer.cancel(); timer = null; timer = new Timer(); } timer.schedule(new TimerTask() { // Thread leaks!!!! @Override public void run() { mCallback.onHeaderMoving(newToolbarTranslationY ); } } , 150); I used MAT Analyser to track down the problem and ended up there. I also commented out

How can I tell lint to track a custodial pointer to a vector?

扶醉桌前 提交于 2019-12-24 00:18:47
问题 I have some code that loops and news up some pointers and stores them in a vector: std::vector<InputBox*> m_octets; ... InputBox* octet = new InputBox(rect, title, touch_num); m_octets.push_back(octet); In the class destructor I for_each over m_octets and invoke the destructor for each pointer. I think this is all good. It all compiles and the unit tests pass. The problem is Gimpel's PC-lint doesn't like it. It sees that `octet' is a custodial pointer that has not been freed (Warning 429). I

PHP/DOMDocument: unset() does not release resources

蓝咒 提交于 2019-12-23 23:53:29
问题 I've got a variable $dom that contains an instance of PHP's DOMDocument. This variable is being set and unset within a loop. unset($dom) will not release memory, though: memory_get_usage(false) reports that only 700B of about 10MB got released. memory_get_usage(true) reports the exact same amount of memory usage before and after unset() . I tried the following: I checked that the reference count of $dom is exactly one immediately before the call to unset() : xdebug_debug_zval('dom') reports:

Possible memory leak with malloc, struct, std::string, and free

邮差的信 提交于 2019-12-23 23:53:28
问题 I've a situation like the following, and I'm not sure whether or not the std::string elements of the struct leak memory or if this is ok. Is the memory allocated by those two std::strings deleted when free(v) is called? struct MyData { std::string s1; std::string s2; }; void* v = malloc(sizeof(MyData)); ... MyData* d = static_cast<MyData*>(v); d->s1 = "asdf"; d->s2 = "1234"; ... free(v); Leak or not? I'm using the void-pointer because I have another superior struct, which consists of an enum

Linux BASH memory leak when redirecting stdio

情到浓时终转凉″ 提交于 2019-12-23 23:13:17
问题 I've got a memory leak somewhere , but it doesn't appear to be related to my program. I'm making this bold statement based on the fact that once my program terminates, either by normal means, seg-faulting, or aborting, the memory isn't recovered. If my program were the culprit, I would assume the MMU would recover everything, but this doesn't appear to be the case. The leak only comes into play when I redirect stdout (in BASH version 2.05 or 4) to a file, as in this is okay: # my-program but

Memory Leak with XmlDocument()

╄→гoц情女王★ 提交于 2019-12-23 22:39:20
问题 I believe I have memory leak with some of my code that uses the XmlDocument class. My program runs on a Windows 6.1.4 device (C#) and reads from a database on another server to see if any programs installed on the device need to be uninstalled and then reads from an XmlDocument to get the names of the programs that are uninstallable. The program then matches the lists and uninstalls accordingly, if necessary. This process is looped infinitely and runs in the background but what I'm noticing

Avoiding memory leak

杀马特。学长 韩版系。学妹 提交于 2019-12-23 22:30:21
问题 So I was learning OOP in C++ and I thought it would be a good practice to write my own string class (for learning purposes, of course). I came up with a problem which I didn't know how to solve. Here's some peace of code: class String { char *str; public: String(char const *str); ~String(); String operator + (char const *str); }; String::String(char *str) { this->str = _strdup(str); } String::~String() { free(this->str); } String String::operator+(char const *str) { char *temp = (char *)