Author: cwiklik
Date: Tue Oct 13 16:02:37 2015
New Revision: 1708455

URL: http://svn.apache.org/viewvc?rev=1708455&view=rev
Log:
UIMA-4585 fixed fd leak causing too many files open error. The new code was not 
closing stat file in /proc 

Modified:
    
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/processors/LinuxProcessMetricsProcessor.java

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/processors/LinuxProcessMetricsProcessor.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/processors/LinuxProcessMetricsProcessor.java?rev=1708455&r1=1708454&r2=1708455&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/processors/LinuxProcessMetricsProcessor.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/processors/LinuxProcessMetricsProcessor.java
 Tue Oct 13 16:02:37 2015
@@ -208,6 +208,7 @@ public class LinuxProcessMetricsProcesso
                                                                        
.getMajorFaults();
                                                        RandomAccessFile raf = 
null;
                                                        try {
+                                                               
System.out.println("------------------ Opening stat file for PID:"+pid);
                                                                raf = new 
RandomAccessFile("/proc/" + pid + "/stat", "r");
                                                                
ProcessCpuUsageCollector processCpuUsageCollector = new 
ProcessCpuUsageCollector(
                                                                                
logger, pid, raf, 42, 0);
@@ -225,6 +226,11 @@ public class LinuxProcessMetricsProcesso
                                                                                
.getTotalJiffies() / agent.cpuClockRate);
                                                                
                                                        } catch( Exception ee) {
+                                                               logger.warn(
+                                                                               
"LinuxProcessMetricsProcessor.process",
+                                                                               
null,ee);
+
+                                                       } finally {
                                                                if ( raf != 
null ) {
                                                                        
raf.close();
                                                                }


Reply via email to