memory-leaks

where is leak in my code?

孤街醉人 提交于 2019-12-22 10:00:02
问题 Here is my code which opens an XML file (old.xml), filter invalid characters and write to another XML file (abc.xml). Finally I will load the XML (abc.xml) again. When executing the followling line, there is exception says the xml file is used by another process, xDoc.Load("C:\\abc.xml"); Does anyone have any ideas what is wrong? Any leaks in my code and why (I am using "using" keyword all the time, confused to see leaks...)? Here is my whole code, I am using C# + VSTS 2008 under Windows

Lot of strange leaks in instruments only on device (no leaks in simulator)

巧了我就是萌 提交于 2019-12-22 09:49:27
问题 I started working with instruments and have a lot of leaks. I don't have an idea how to solve them. Instrument show that i have leak in this line: NSArray *topLevelObjects = [[NSArray alloc] initWithArray:[[NSBundle mainBundle] loadNibNamed:@"SearchResultsTableViewCell" owner:self options:nil]]; What is wrong with this? // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString

Java Apache-poi, memory leak with excel files

纵然是瞬间 提交于 2019-12-22 09:28:48
问题 I need to read (15000) excel files for my thesis. I'm using apache poi to open and later to analyze them but after around 5000 files I'm getting the following exception and stacktrace: Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.attr(Cur.java:3044) at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.attr(Cur.java:3065) at org.apache.xmlbeans.impl.store.Locale$SaxHandler.startElement(Locale.java:3263)

Flex ModuleLoader component causing memory leak. How can I unload Modules properly?

戏子无情 提交于 2019-12-22 09:03:06
问题 The application is too big to describe here, but I can tell you I have up to 20 modules or more that the client can use at any time. And if I go on loading screen after screen, my application can ocuppy 500MB and more. The script that I use to load and unload modules is: public function createModule(modulo:String):void { if(moduleLoader != null){ moduleLoader.unloadModule(); //moduleLoader.url = null; moduleLoader.url = "com/oss/facturable/components/" + modulo + "?version=" + model.configXML

How to release correctly memory in iOS: Memory is never released; potential leak of memory pointed to by

£可爱£侵袭症+ 提交于 2019-12-22 09:02:16
问题 I have the next code developed for converting an NSMutableString object into NSData object: -(NSData *)desSerializarFirma:(NSMutableString *)firma{ NSArray *arregloBits = [firma componentsSeparatedByString:@","]; unsigned c = arregloBits.count; uint8_t *bytes = malloc(sizeof(*bytes) * c); unsigned i; for (i = 0; i < c; i ++) { NSString *str = [arregloBits objectAtIndex:i]; int byte = [str intValue]; bytes[i] = (uint8_t)byte; } return [NSData dataWithBytes:bytes length:c]; } when I analyze

What Operating Systems Will Free The Memory Leaks?

让人想犯罪 __ 提交于 2019-12-22 08:59:26
问题 I've got a desktop program. Most Operating Systems run the program in its own address space. When the program exits, I believe most operating systems free the memory allocated by the program and return it to the memory stack for reuse. What I am not sure of, is if the program has a memory leak, will the memory "leaked" also be returned for reuse, or is it lost until the machine is rebooted? This is a followup to the question I asked earlier today: Do Small Memory Leaks Matter Anymore?, and a

Android strict mode detects multiple activity instance violation, but I have no idea why

本秂侑毒 提交于 2019-12-22 08:55:46
问题 Code is probably too complex to post here in full, but here is the basic schema: I have two Activity subclasses, each of which hosts a ListView . Each ListView has an adapter of a custom class, which generates View instances also of a custom class. These lists are showing data items that are generated asynchronously in another thread; as it needs to know where to send updates to, the data objects it manipulates have WeakReference<> objects that are set to hold references to the adapters

Lua memory leak in C process

强颜欢笑 提交于 2019-12-22 08:55:06
问题 I have a C program running with Lua. Although I try to use lua_gc() to get and control memory usage of Lua, C process memory usage is still high. The C process uses over 150MB memory even though Lua say that it uses only 4MB memory. I also try to use my l_alloc() function to track Lua memory allocation, but the result is the same with the memory usage Lua told by calling lua_gc(LUA_GCCOUNT) and lua_gc(LUA_GCCOUNTB). After calling lua_close() to close the Lua environment, the process memory is

fork with invalid command cause a memory leak in valgrind

余生颓废 提交于 2019-12-22 08:48:36
问题 I have the following code which execute a non valid command within a fork. The following code return a memory leak in valgrind. #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <errno.h> #include <unistd.h> int external_cmd(char **argv) { int pid; if ((pid = fork()) == -1) return -1; if (pid == 0) { /* child */ execvp(argv[0], argv); exit(0); } else if (pid < 0) return -1; int status; while (wait(&status) != pid); return 0; } int main () { char *argv[8]

Linq to SQL DataContext Windsor IoC memory leak problem

心已入冬 提交于 2019-12-22 08:41:13
问题 I have an ASP.NET MVC app that creates a Linq2SQL datacontext on a per-web-request basis using Castler Windsor IoC. For some reason that I do not fully understand, every time a new datacontext is created (on every web request) about 8k of memory is taken up and not released - which inevitably causes an OutOfMemory exception. If I force garbage collection the memory is released OK. My datacontext class is very simple: public class DataContextAccessor : IDataContextAccessor { private readonly