Questions tagged [resource-leak]

191 questions
5
votes
1 answer

What happens to file descriptors in Python 3 when .close() fails?

The following Python 3 code exhibits some strange behavior (to me, at least) when I run it through strace: import os import sys if len(sys.argv) != 2: print('Usage: ecpy ') sys.exit(1) try: print('my PID: %d' % os.getpid()) …
Samuel Isaacson
  • 335
  • 3
  • 5
4
votes
1 answer

Jersey client connection close memory leak issue

I am using Jersey v10 and have written the following code.Is this the right way to close a Jersey client connection to avoid memory leaks.I was not doing any calls int he finally before this. ClientConfig config = setupHttps(); final Client c =…
Vijay
  • 469
  • 1
  • 9
  • 25
4
votes
2 answers

How do I track down a Windows USER object leak?

I have a program that is leaking USER objects which can be seen in Task Manager. Is there a way to determine which type of resource is being leaked? I've used programs like GDI View for GDI leaks which breaks it down by object type. Is there…
Ryand
  • 436
  • 4
  • 16
4
votes
1 answer

If a Go sql.DB is closed, do any unclosed prepared queries get closed?

In a Go program using database/sql, will any unclosed prepared queries be closed when I Close the Postgres DB I'm using? I've cut this down to a very simple example that does not need the Prepare but still shows the question (I believe I could just…
WilliamKF
  • 36,283
  • 61
  • 170
  • 271
4
votes
3 answers

How to solve failure to close a FileStream

I have closed file steam in try/finally, but code analysis warns me: Possible failure to close a FileOutputStream Possible failure to close a PrintWriter Possible failure to close an OutputStreamWriter How can failure happen? How can I ensure…
tensor
  • 43
  • 2
4
votes
1 answer

How should I go about debugging a Mach port leak?

I have a server written in c++ that leaks Mach ports when run on osx. Specifically, when running top I noticed that it had around 50000 (under #PORTS) . Curiously, I left it running overnight and the next day the machine was basically dead (took…
Bwmat
  • 3,746
  • 2
  • 22
  • 38
4
votes
5 answers

Diagnosing Cause of 100% CPU Usage by "System" Process

I have a Windows server application, implemented in C++ using the Win32 API, that does a lot of serial and TCP/IP communication. As it runs, CPU usage gradually increases, until it reaches 100%. Task Manager indicates that most (>75%) of the CPU…
Kristopher Johnson
  • 76,675
  • 54
  • 235
  • 299
4
votes
3 answers

Will stream classes or connections considered as a resource leak in Java

Java has no lifetime for an object, this is managed by the garbage collector. And if I use some IO classes without closing it, or some DBConnection, will this considered a resource leak? In another words, will IO object be collected and destroyed by…
Joey.Z
  • 3,450
  • 4
  • 30
  • 59
4
votes
4 answers

COM:Can i call CoUninitialize without calling Release?

I have a doubt. I initialize COM, do CoCreateInstance and use some interfaces.Can I call CoUninitialize without calling Release? Does it cause any memory/resource leak? Thanks in Advance, -Mani.
Manigandan
4
votes
2 answers

Eclipse 4.2 resource leak through separate close method

I'm using Eclipse 4.2 with resource leak warnings enabled. This code produces an, in my opinion false, resource leak warning. public static void test(){ InputStream in = null; try { in = new FileInputStream("A"); } catch (IOException e)…
Franz Kafka
  • 9,999
  • 17
  • 86
  • 145
3
votes
1 answer

boost::process system leaking file descriptors

It seems like boost::process::system is leaking fds: Let's say I have this simple code to flush iptables config every 3 seconds (just an example): #include #include int main(void) { while(true) { …
3
votes
1 answer

Memory leak issue. Instument shows error in line 2

NSArray *arrAllAttributes = [[NSArray alloc]init]; arrAllAttributes = [app mtdAllCountry]; [arrAllAttributes retain]; for(int i = 0; i<[arrAllAttributes count]; i++) { NSDictionary *dictTemp1 = [[NSDictionary alloc]init]; NSString…
Baby Groot
  • 4,609
  • 39
  • 50
  • 67
3
votes
1 answer

How to detect GDI resource leaks in managed C# screensaver?

Here's my problem ... I suspect a GDI Resource leak in my C# screensaver that uses only managed code. Error: 'Out of memory' after many operations. I compile using VS Prof 2013 Update 4 and run under Windows 7 64bit. I use Dispose and non-static…
Aendie
  • 191
  • 12
3
votes
2 answers

Android memory leak on static Resource member variable?

Is it safe to have static reference to private static Resources mRes; in my Utils class, initalized as follows? public static void init(Resources res) { mRes = res; } .. later in activity Utils.init(getContext().getResources()); It seems to me…
3
votes
2 answers

JAI create seems to leave file descriptors open

I have some old code that was working until recently, but seems to barf now that it runs on a new server using OpenJDK 6 rather than Java SE 6. The problem seems to revolve around JAI.create. I have jpeg files which I scale and convert to png…
MrSilverSnorkel
  • 419
  • 1
  • 4
  • 17
1 2
3
12 13