memory-leaks

JavaScript: should I worry about memory leaks in 2011?

自古美人都是妖i 提交于 2019-12-31 08:12:18
问题 The topic of memory leaks in JavaScript is not brought up often. However, I stumbled upon this article, written in 2007. The authors state: Internet Explorer and Mozilla Firefox are the two Web browsers most commonly associated with memory leaks in JavaScript. Should I still be worrying about JavaScript memory leaks in 2011? If so, what should I be careful about? 回答1: A good javascript developer would be aware of various design patterns that can lead to memory leaks and you'd avoid coding

QThread is creating a memory leak

拥有回忆 提交于 2019-12-31 07:36:07
问题 After much testing and changes to my QT application, Visual Leak Detector identified the source of a pesky leak (8 bytes). VLD reported the QT application is clean except for a QThread* pointer. A bit of implementation background: the application is modelled as a hybrid of solution by Jeffrey Holmes, Bulk download of web pages using Qt. Thanks to Jeffrey for the earlier solution! Questions: Why is QThread* not destroying itself when the worker thread completed its work? How can I force the

C# Timer and memory leak

雨燕双飞 提交于 2019-12-31 05:38:11
问题 I am creating a program that will check for directory listing every 2 seconds. I expect this program to run for months without leaking memory or requiring any human interaction. Below program has memory leak. I am still not sure what the 10K represents. It is not the interval. The interval is 2k. class Program { static void Main(string[] args) { Timer aTimer = new Timer(10000); aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); aTimer.Interval = 2000; aTimer.Enabled = true; Console

Is it necessary to clearTimeout inside a recursively invoked timer?

眉间皱痕 提交于 2019-12-31 04:29:27
问题 Is it necessary to call clearTimeout() inside a recursively invoked function in Coffeescript? My concern is whether not calling clearTimeout() will possibly cause some sort of memory leak over time if this function is run many many times per second. My thinking is the JS garbage collector handles this, but want to double check. A contrived example from a websockets/socket.io implementation I'm working on: socket.on 'dataReceived', => @_recursive_fn() _recursive_fn: -> @timer = setTimeout (=>

do I need to close an audio Clip?

喜欢而已 提交于 2019-12-31 04:11:12
问题 have an application that processes real-time data and is supposed to beep when a certain event occurs. The triggering event can occur multiple times per second, and if the beep is already playing when another event triggers the code is just supposed to ignore it (as opposed to interrupting the current beep and starting a new one). Here is the basic code: Clip clickClip public void prepareProcess() { super.prepareProcess(); clickClip = null; try { clipFile = new File("C:/WINDOWS/Media/CHIMES

PHP Excel Memory Limit of 2GB Exhausted reading a 286KB file

此生再无相见时 提交于 2019-12-31 04:07:24
问题 Addtitional info: I'm running this from the command line. CentOS 6, 32GB Ram total, 2GB Memory for PHP. I tried increasing the memory limit to 4GB, but now I get a Fatal error: String size overflow . PHP maximum string size is 2GB. My code is very simple test code: $Reader = new SpreadsheetReader($_path_to_files . 'ABC.xls'); $i = 0; foreach ($Reader as $Row) { $i++; print_r($Row); if($i>10) break; } And it is only to print 10 rows. And that is taking 2 Gigabytes of memory? The error is

memory leaks when program is closed with x

戏子无情 提交于 2019-12-31 03:42:08
问题 Might be a stupid question, but if I create a console-application that dynamicly creates object and such, I make sure to free the memmory at shutdown. What happens if a user closes the application with the "x" button on the window? will there be memoryleaks and if so, how do i prevent it? 回答1: No, there won't be any memory leaks. When a user closes your application the process in which your appication runs gets terminated.Once a process gets terminated, the Operating System(OS) simply

Jvm is using more memory than Native Memory Tracking says, how do I locate where the extra meeory goes? [duplicate]

笑着哭i 提交于 2019-12-31 02:24:06
问题 This question already has answers here : Java process memory usage (jcmd vs pmap) (3 answers) Where do these java native memory allocated from? (1 answer) Closed 2 years ago . I'm running jetty on my web server. My current jvm setting: -Xmx4g -Xms2g, however jetty uses a lot more memory and I don't know where these extra memory goes. Jetty uses 4.547g memory in total: heap usage shows heap memory usage at 2.5g: Heap Usage: New Generation (Eden + 1 Survivor Space): capacity = 483196928 (460

Memory leak with ABPeoplePickerNavigationController?

*爱你&永不变心* 提交于 2019-12-31 02:14:11
问题 I'm using this code to display the contacts in an app. - (IBAction) selectContact:(id)sender { ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; NSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonAddressProperty], nil]; picker.displayedProperties = displayedItems; [self presentModalViewController:picker animated:YES]; [picker release]; } and there is a memory leak, according to

invalid statement in fillwindow() in Android

妖精的绣舞 提交于 2019-12-31 00:45:27
问题 I newbie in Android and before ask question here i was googling, but on this question i can't find answer. (also this stackoverflow.com/questions/4195089 don't have answer). In my test app on emulator i have error ERROR/Cursor(1512): Invalid statement in fillWindow() on LogCat when i press back button on second activity. 11-23 19:06:05.050: DEBUG/TestDB/Debug/MainActivity(1512): onCreate 11-23 19:06:06.820: DEBUG/TestDB/Debug/MainActivity(1512): openDataBase 11-23 19:06:07.240: DEBUG/TestDB