[Mono-bugs] [Bug 73183][Nor] New - Optimization to prevent multiple handles to /dev/urandom device
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 email@example.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 @@
+Product: Mono: Class Libraries
+OS: SLES 9
+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.
+There can be many handles waiting to be cleaned up.
+With the patch we only ever see two. (I'm not sure what object creates
+the second one)
+How often does this happen?