file-descriptor

IOException: Too many open files

ε祈祈猫儿з 提交于 2019-12-18 10:19:39
问题 I'm trying to debug a file descriptor leak in a Java webapp running in Jetty 7.0.1 on Linux. The app had been happily running for a month or so when requests started to fail due to too many open files , and Jetty had to be restarted. java.io.IOException: Cannot run program [external program]: java.io.IOException: error=24, Too many open files at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at java.lang.Runtime.exec(Runtime.java:593) at org.apache.commons.exec.launcher

How can I read from a specific raw file descriptor in Rust?

北城以北 提交于 2019-12-18 04:54:09
问题 Editor's note: This question is for a version of Rust prior to 1.0. Some answers have been updated to cover Rust 1.0 or up, but not all. I am writing a systemd socket activated service in Rust. My process is being handed an open file descriptor by systemd. Are there any Rust IO functions that take a raw file descriptor? I'm using a Rust nightly before Rust 1.0. 回答1: I think right now your best bet is probably using the libc crate for working with raw file descriptors. The movement of FileDesc

Finding open file descriptors for a process linux ( C code )?

别等时光非礼了梦想. 提交于 2019-12-17 17:45:08
问题 I wanted to find all fds opened for a process in linux. Can I do it with glib library functions ? 回答1: Since you're on Linux, you've (almost certainly) got the /proc filesystem mounted. That means that the easiest method is going to be to get a list of the contents of /proc/self/fd ; each file in there is named after a FD. (Use g_dir_open , g_dir_read_name and g_dir_close to do the listing, of course.) Getting the information otherwise is moderately awkward (there's no helpful POSIX API for

Is O_LARGEFILE needed just to write a large file?

♀尐吖头ヾ 提交于 2019-12-17 16:29:03
问题 Is the O_LARGEFILE flag needed if all that I want to do is write a large file ( O_WRONLY ) or append to a large file ( O_APPEND | O_WRONLY )? From a thread that I read titled "Cannot write >2gb index file" on the CLucene-dev mailing list, it appears that O_LARGEFILE might be needed to write large files, but participants in that discussion are using O_RDWR , not O_WRONLY , so I am not sure. 回答1: O_LARGEFILE should never be used directly by applications. It's to be used internally by the 64-bit

Get list of open files (descriptors) in OS X

ⅰ亾dé卋堺 提交于 2019-12-17 15:39:44
问题 I would like to get a list of open files in a process on os x (10.9.1). In Linux I was able to get this from /proc/PID/fd . However I'm not sure how to get the same on OS X. I found that the procfs is not present on the OS X (by default. possible implementations present, but I do not want to go that way). So how do I get (natively) the list of open files in a process on OS X. One way is lsof . is there any other support available? please let me know where I can get more info on this. Thanks.

Check the open FD limit for a given process in Linux

孤街醉人 提交于 2019-12-17 15:26:45
问题 I recently had a Linux process which "leaked" file descriptors: It opened them and didn't properly close some of them. If I had monitored this, I could tell - in advance - that the process was reaching its limit. Is there a nice, Bash\Python way to check the FD usage ratio for a given process in a Ubuntu Linux system? EDIT: I now know how to check how many open file descriptors are there; I only need to know how many file descriptors are allowed for a process . Some systems (like Amazon EC2)

Stream live video from phone to phone using socket fd

穿精又带淫゛_ 提交于 2019-12-17 15:23:08
问题 I am new to android programming and have found myself stuck I have been researching various ways to stream live video from phone to phone and seem to have it mostly functional, except of course the most important part: playing the stream. It appears to be sending the stream from one phone, but the second phone is not able to play the stream. Here is the code for the playing side public class VideoPlayback extends Activity implements Callback { MediaPlayer mp; private SurfaceView mPreview;

Stream live video from phone to phone using socket fd

℡╲_俬逩灬. 提交于 2019-12-17 15:18:15
问题 I am new to android programming and have found myself stuck I have been researching various ways to stream live video from phone to phone and seem to have it mostly functional, except of course the most important part: playing the stream. It appears to be sending the stream from one phone, but the second phone is not able to play the stream. Here is the code for the playing side public class VideoPlayback extends Activity implements Callback { MediaPlayer mp; private SurfaceView mPreview;

Process leaked file descriptors error on JENKINS

佐手、 提交于 2019-12-17 10:58:43
问题 I am getting this error when I configured a job to do stop and start of tomcat server: Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information When i googled it, i got a recommended solution as set BUILD_ID=dontKillMe Is this the exact solution? If yes, where do I need to set BUILD_ID? Inside ant/post build script? Can anyone please clarify this? 回答1: Yes, creating fake BUILD_ID for process tells Jenkins to ignore this

Portable way to pass file descriptor between different processes

人走茶凉 提交于 2019-12-17 03:09:32
问题 On most UNIX systems passing an open file between processes can be easily done for child/parent processes by fork(); however I need to share a fd "after" the child was already forked. I've found some webpages telling me that sendmsg() may work for arbitary processes; but that seems very OS dependent and complex. The portlisten seems like the best example I can find, but I'd prefer a good wrapper library like libevent that hides all the magic of kqueue, pool, .... Does anyone know if there's