memory-leaks

NSEnumerator memory leak

ε祈祈猫儿з 提交于 2019-12-24 07:18:16
问题 This leaks like mad, due to the way I use enumerators. Why? It leaks even more severely if I don't release the enumerator - I understand that much.. but I don't understand why this still leaks. #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; // insert code here... NSLog(@"Hello, World!"); // Create an array and fill it with important data! I'll need to enumerate this. NSMutableArray *myArray = [

Bad memory management? Class member (boolean) value greater than 1, in recursion function

孤人 提交于 2019-12-24 07:15:22
问题 I am working on a subgraph matching problem (match chemical functional groups within molecules). The original code was written by another student (under Visual C++, no MS specific libraries) and it ran fine on Windows . I then added new functions to the program but did not alter the algorithm for the subgraph matching, and the new program compiled fine under gcc4.2/Mac OS X. However I am running into strange problems during runtime! The objects & their members that are relevant here: Atom:

Loading multiple xml files with c# XmlDocument leading to memory leakage

此生再无相见时 提交于 2019-12-24 06:59:10
问题 I am having serious troubles with processing a big number of xml files using XmlDocument . The idea is to extract from about 5000 .xml docs (approx. 20 MB each) a certain data, which is saved in text format and then imported into MySQL DB. This task is supposed to be done every day. My problem is that after processing of each xml file, the system memory is not releasing it. So, all the documents are pilling up, until all the RAM is occupied and the application starts to run very slowly (once

what kind of problems can lack of deallocation cause?

女生的网名这么多〃 提交于 2019-12-24 05:41:56
问题 i am currently experiencing a problem were i get *** glibc detected *** ./efit: free(): invalid next size (fast): 0x00000000006127f0 *** with the usual memory map and backtrace information that comes with a glibc error. i am, however, unable to find the cause of this problem. it seems like (basically) my entire program is finished by the time this happens. one thing i read online is that this could be due to lack of deallocation. now, i have been running the program without deallocating a few

what kind of problems can lack of deallocation cause?

僤鯓⒐⒋嵵緔 提交于 2019-12-24 05:41:02
问题 i am currently experiencing a problem were i get *** glibc detected *** ./efit: free(): invalid next size (fast): 0x00000000006127f0 *** with the usual memory map and backtrace information that comes with a glibc error. i am, however, unable to find the cause of this problem. it seems like (basically) my entire program is finished by the time this happens. one thing i read online is that this could be due to lack of deallocation. now, i have been running the program without deallocating a few

Closing JavaFX tabs doesn't release memory from ArrayLists and TableViews in that tab

女生的网名这么多〃 提交于 2019-12-24 05:19:06
问题 I've been trying to figure out why a JavaFX based application I am working on uses up so much memory. I noticed memory went up each time I opened a new tab in the application, and wasn't being GC after I had closed the tab. I would keep opening and closing tabs until eventually it ran out of memory and crashed. So I wrote and tried a very simple program and GUI. The code is below. What I found was that if I set the items in the TableView to null, cleared out the ArrayList, and instantiated a

No leaks appearing in Instruments, even though I'm sure they exist

雨燕双飞 提交于 2019-12-24 05:14:05
问题 I'm checking for leaks in Instruments, and I've set to check every second, but no leaks are appearing. I'm sure there must be some in my app, is there anything which could stop these from appearing? Is there a good way I can create a leak so that I can test if leaks do show up in Instruments? Thanks! 回答1: You're only going to find leaks with a tool if an object is allocated but no longer referenced. Another type of "leak" is to hold a reference to something that you didn't intend to. This

How do I know when I ought to free strings in C returned by library functions?

时光毁灭记忆、已成空白 提交于 2019-12-24 04:56:12
问题 Which strings ought I to free in C on my own, using free() ¹? My state of knowledge: char a[256]; : no char *a = "abcdefg"; : no char *a = malloc(15L); : yes a string returned by getenv() : no strings returned by Windows functions²: ??? ¹ or LocalFree()/ GlobalFree() / VirtualFree() ² in particular by GetCommandLineW() 回答1: This will always be mentioned in the documentation for any API you use that returns strings (or other data larger than a single simple value such as an integer). Yes, this

Is my Glassfish setup leaking memory?

﹥>﹥吖頭↗ 提交于 2019-12-24 04:40:06
问题 I've got a Glassfish v3 server running a few web applications (servlets, JSP, JDBC). I'd been noticing that if I let Glassfish run for a long time, it will consume all of the memory available (this is running on a server with 750 MB of memory). I figured that there must be a memory leak, so I ran the server while monitoring it with JProfiler and noticed that when I get a peak in traffic, my memory usage shoots up (as expected), but then quickly drops back down. I'm wondering if the issue is

Memory leak testing and constant variables

☆樱花仙子☆ 提交于 2019-12-24 03:59:05
问题 I'm working on tests to detect memory leaks for classes. I do this with the following pattern: Get initial memory in test setup (using GC.GetTotalMemory(true) ) Perform operations, such as instantiation of objects Dispose object (through useage block) Get memory in test tear down (using the same method again, all objects are out of scope and therefore should be garbage collected) Ideally, assert that the different between initial and end memory = 0 Using memory profiling tools in my tests, I