[Mono-bugs] [Bug 73183][Nor] New - Optimization to prevent multiple handles to /dev/urandom device

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 1 Mar 2005 19:01:20 -0500 (EST)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by mlasky@novell.com.


--- shadow/73183	2005-03-01 19:01:20.000000000 -0500
+++ shadow/73183.tmp.22578	2005-03-01 19:01:20.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 73183
+Product: Mono: Class Libraries
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mlasky@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: Optimization to prevent multiple handles to /dev/urandom device
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+The RNGCryptoServiceProvider object would create a handle to 
+the /dev/urandom device every time a new object was created. These 
+handles accumulate until the object finalizer is run. Since SLES9 is 
+limited to 1024 handles per process, we were running out of handles under 
+a heavy load on the web server because each SessionState object 
+constructed a RNGCryptoServiceProvider object and the garbage collector 
+hadn't got around to running yet to reclaim the objects.
+Changed the handle to the /dev/urandom device to be a static and let it 
+be cleaned up when the process terminates.
+A patch file is submitted showing the changes that were made.
+Steps to reproduce the problem:
+1. Create a web service that uses sessions and run multiple clients at it.
+2. Check in the /proc directory for the process and view the file handles 
+allocated to it.
+Actual Results:
+There can be many handles waiting to be cleaned up.
+Expected Results:
+With the patch we only ever see two. (I'm not sure what object creates 
+the second one)
+How often does this happen? 
+Additional Information: