Questions tagged [resource-leak]

191 questions
0
votes
4 answers

Java Resource Leak

I have this code snippet in my application and I am quite sure that I have closed all the streams. But, surprisingly, I keep getting: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on…
iHavADoubt
  • 79
  • 1
  • 9
0
votes
1 answer

debugging a resource leak in a printer driver

I'm trying to debug a memory leak in a printer driver. I'm pretty sure it's a resource leak, not just a plain memory leak because analyzing heap with !heap -s in windbg doesn't show any increase. How do I monitor other kinds of objects with…
MK.
  • 31,408
  • 15
  • 67
  • 104
0
votes
3 answers

How do I use a Scanner only once then get rid of it?

I have a program in java, in which I have to get user input, however, I only need to get the user input once, after that, I do not need a scanner anymore. Doing the following: int userInput = new Scanner(System.in).nextInt(); Gives me a Resource…
Shadow
  • 3,666
  • 4
  • 17
  • 40
0
votes
1 answer

File descriptor leak in Apache HttpAsyncClient

When running on Linux (only tried on Linux), the following code seems to leak 1 anon_inode, and 2 pipe file descriptors, according to lsof: CloseableHttpAsyncClient client = HttpAsyncClients.createDefault(); client.start(); client.close(); If,…
Paul Draper
  • 64,883
  • 37
  • 172
  • 246
0
votes
1 answer

if a linux program exit with coredump, the unclosed files may lead a resource leak

As we know, the os will clean up any allocated memory after the program exited. but how about the opened or created files after coredump?
wuwl
  • 481
  • 1
  • 5
  • 10
0
votes
0 answers

Does java leak memory when an object is open()-ed but never close()-d?

Just to understand the various ways in which memory leaks can happen in Java. Is it safe to say that the most general way is when a reference to an object is created and never released? Ex : DBManager db = new DBManager(); db.open(); and no call…
Arunabh Das
  • 11,928
  • 18
  • 73
  • 102
0
votes
1 answer

ipython notebook and leaking file descriptors

I'm having problems with leaking file descriptors in code I have running in ipython notebook. I'm downloading lots of files with urllib2 and saving them locally. Apparently, urllib2 has a history of leaking file descriptors, which I suspect is…
drevicko
  • 12,832
  • 12
  • 63
  • 87
0
votes
1 answer

Does CImageList removes resources?

I have came across with a GDI leaking problem in our project so I started to search for possible issues. I have found a place where the implementor created new instances of icons with LoadIcon and I do know that we have to delete the resource with…
newhouse
  • 1,064
  • 1
  • 10
  • 24
0
votes
1 answer

How to do local IPC without leaking handles (cross platform)?

How can I initiate IPC with a child process, without letting it inherit all handles? To make it more interesting, this shoud work on windows as well as unix. The background: I am writing a library that interfaces with a 3rparty shared library (let's…
coldfix
  • 4,809
  • 3
  • 32
  • 45
0
votes
3 answers

File Reading in Java, with same file readers

I have two files to be read using same variables for the task with the following code: try { FileInputStream fis = new FileInputStream(filename1); InputStreamReader isr = new InputStreamReader(fis, "UTF8"); …
Shaik Md
  • 567
  • 4
  • 7
  • 21
0
votes
1 answer

Blackfin uClinux socket creation failure

My client has an old version of uClinux, kernel 2.6.22, running on a Blackfin STAMP board. The main application is divided into 14 processes, plus there's a webserver running on the board. The bug we're seeing, the webserver keeps running happily…
0
votes
1 answer

After Full GC yet the instances of socket keep growing?

I have socket application with the code snippet as below. I have ensured that the socket is closed in a finally block. I just had a Full GC I guess either yesterday or the day before. Then I compare the instances of the socket via jmap before this…
user2711681
  • 275
  • 6
  • 16
0
votes
2 answers

Resource leak 'blank' never closed

It seems that when I create my scanner I get this error. I have tried to solve this by searching the error name, but have so far been unsuccessful in getting the message to stop appearing. Code: import java.util.Scanner; public class PrintQueue { …
user1730357
  • 335
  • 4
  • 7
  • 15
0
votes
3 answers

Creating a dialog in the onCreate method - Leak

I'm seem to intermittently be getting the following error when I'm running my app. "Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40521348 that was originally added here" All I'm doing is creating my dialog in my…
Zippy
  • 3,561
  • 5
  • 34
  • 90
0
votes
2 answers

Resource leak warning on file stream

private void SaveLog(boolean externalStorage) { String s = tv_log.getText().toString(); File file; FileOutputStream fos; if ( externalStorage ) { try { file = new File(getExternalFilesDir(null),…
Alex F
  • 39,172
  • 34
  • 138
  • 200
1 2 3
12
13