[Mono-list] "Out Of Memory" error using Novell's LDAP library

Adam Tauno Williams awilliam@whitemice.org
Sat, 20 Nov 2004 09:42:41 -0500


I'm geeting the following result -

Search Issued...
requesting ldapMessage from ldapSearchQueue
 
Unhandled Exception: System.OutOfMemoryException: Out of memory
in (unmanaged) (wrapper managed-to-native)
System.Object:__icall_wrapper_mono_array_new_specific (intptr,int)
in <0x00004> (wrapper managed-to-native)
System.Object:__icall_wrapper_mono_array_new_specific (intptr,int)
in <0x00027> Novell.Directory.Ldap.Asn1.LBERDecoder:decodeOctetString
(System.IO.Stream,int)
in <0x00045> Novell.Directory.Ldap.Asn1.Asn1OctetString:.ctor
(Novell.Directory.Ldap.Asn1.Asn1Decoder,System.IO.Stream,int)
in <0x0003a> Novell.Directory.Ldap.Asn1.Asn1Tagged:.ctor
(Novell.Directory.Ldap.Asn1.Asn1Decoder,System.IO.Stream,int,Novell.Directory.Ldap.Asn1.Asn1Identifier)
in <0x002b8> Novell.Directory.Ldap.Asn1.LBERDecoder:decode
(System.IO.Stream,int[])
in <0x00049> Novell.Directory.Ldap.Asn1.Asn1Structured:decodeStructured
(Novell.Directory.Ldap.Asn1.Asn1Decoder,System.IO.Stream,int)
in <0x00027> Novell.Directory.Ldap.Asn1.Asn1Sequence:.ctor
(Novell.Directory.Ldap.Asn1.Asn1Decoder,System.IO.Stream,int)
in <0x00013> Novell.Directory.Ldap.Rfc2251.RfcSearchResultEntry:.ctor
(Novell.Directory.Ldap.Asn1.Asn1Decoder,System.IO.Stream,int)
in <0x0016a> Novell.Directory.Ldap.Rfc2251.RfcLdapMessage:.ctor
(Novell.Directory.Ldap.Asn1.Asn1Decoder,System.IO.Stream,int)
in <0x0016c> ReaderThread:Run ()
in <0x00053> (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void ()

- when in the following code snippet -

ldapSearchQueue =  
	ldapConnection.Search(
		searchRoot,
		LdapConnection.SCOPE_SUB,
		searchFilter,
		null, false, null, null);
Console.WriteLine("Search Issued...");
try {
	Console.WriteLine("requesting ldapMessage from ldapSearchQueue");
	ldapMessage = ldapSearchQueue.getResponse();
	Console.WriteLine("ldapMessage returned from ldapSearchQueue");
	if (ldapMessage == null) {
	...
		}
	} catch (Exception ex) {
		Console.WriteLine("Exception!");
		Console.WriteLine("Exception Message: {0}", ex.Message);
		Console.WriteLine("Exception Stack Trace: {0}", ex.StackTrace);
		}	

- the exception actually seems to occur inside
ldapSearchQueue.getResponse().  Has anyone elese experienced this?  Can
I make a buffer bigger somewhere?  (The object contains an octet string
wil a value ~300k in size).   The wierd thing is that occasionally it
works without an error.