From: Graham B. <gb...@po...> - 2001-05-29 16:21:34
|
It is taking so much memory because it is reading all the results into memory before returning for you to process them. I suspect you don't really need all of the entries, so try modifying your filter to result the resutl set that is being sent. If this is not possible, try using the callback option. This allows you to process each entry as it arrives from the server. Graham. On Tue, May 29, 2001 at 09:41:54AM +0100, Graham Barr wrote: > ----- Forwarded message from Simon Allard <sim...@st...> ----- > > Date: Tue, 29 May 2001 17:51:59 +1200 (NZST) > To: <gb...@po...> > From: Simon Allard <sim...@st...> > Subject: Problem with Net::LDAP > > Hey Graham. > > I am hopeing you can shed some light on this. I have this problem where > your module seems to chew up a lot of memory. > > I am running openldap 2.0.7 with perl-ldap-0.23. > > In openldap I have Aprox 95000 entrys. Each entry looks similar to this: > > dn:loginName=dbs, ou=auth, dc=domain, dc=co, dc=nz > objectclass: AuthAccount > loginName: dbs > userPassword: {crypt}sgaCZydxWDFD > nasAccess: SOMETHING > smtpAuth: 0 > overrideProfile: 1 > multicast: 0 > > When I do a basic search eg: > > if (!$ldap->bind("cn=Manager, $authbase", password => $authpass, async => 1)) { > print "Ldap Bind failed!\n"; > exit 1; > } > my $mesg = $ldap->search( > base => "$authbase", > filter => '(objectclass=ihugAuthAccount)' > ); > > $ldap->unbind; > > This search seems to chew up over 250meg of Ram. It pretty much makes the > perl module unusable. Do you have any suggestions on how I could get the > memory usage down to something reasonable? > > Also doing the unbind seems to take a very long time :( > > Hope you can help. > Thanks in Advance. > > Regards > Simon Allard > > > > Simon Allard (Senior Tool Monkey) > IHUG > Ph (09) 358-5067 Email: sim...@st... > > The real fighting men and women of the 21st century will continue > to be techo's backed up by the grunts with bad haircuts and rifles. > > > ----- End forwarded message ----- |