atos1990 / orika

Automatically exported from code.google.com/p/orika
0 stars 0 forks source link

File handle leak on Linux (Cent OS version 6) #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the mapper on Linux results in leaked file handles. Once the number of 
open file handles exceeds the OS level limit, the mapper fails to work as the 
JavassistCompilerStrategy considers the type to be mapped in accessible as it 
is impossible to open an InputStream to check for existence.

This presents on Cent OS version 6 with Orika 1.0, the issue is not encountered 
on Windows 7 professional x64.

Based on my investigation, the symptom of the problem is also the cause - the 
assureTypeIsAccessible method in JavassistCompilerStrategy opens an InputStream 
to check for file existence but does not close it. After changing this to 
opening a URL to check for file existence we have not encountered the issue. 
I've attached a patch with this change for review and consideration.

Original issue reported on code.google.com by R.Malone...@gmail.com on 20 Mar 2012 at 6:01

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by elaat...@gmail.com on 2 Apr 2012 at 11:26

GoogleCodeExporter commented 9 years ago
Done in the 1.1.0

Original comment by elaat...@gmail.com on 20 Apr 2012 at 2:59