Menu

UnboundID ldap SDK

Annapoorna
2014-02-10
2014-02-11
  • Annapoorna

    Annapoorna - 2014-02-10

    I'm getting 'out of memory..' error when I try to run my android app for listing users from AD. My AD contains thousands of users. I used code from 'https://www.unboundid.com/products/ldap-sdk/docs/ldapsdk-faq.php'. But when I run the app, it throws this error. Is there a way I can list users in my app from AD. How to rectify this error. Kindly help me!

     
  • Neil Wilson

    Neil Wilson - 2014-02-10

    The default behavior of the LDAP SDK is to collect search result entries in a list that is made available in the search result. However, this is not a good idea for searches that may return a large number of entries because it can require a large number of entries. Instead, you should use an alternate approach that doesn't require holding all of the entries in memory. There are several possibilities, including:

    . Use the com.unboundid.ldap.sdk.SearchResultListener in order to have your application process each entry as it received from the serer.

    . Use the com.unboundid.ldap.sdk.LDAPEntrySource class (which uses the SearchResultListener interface behind the scenes) and allows you to access entries via an iterator-like API.

    . Use a control that allows you to retrieve the result set in smaller sets of entries that can be retrieved with separate searches. The LDAP SDK supports both the simple paged results control (com.unboundid.ldap.sdk.controls.SimplePagedResultsControl) and the virtual list view control (com.unboundid.ldap.sdk.controls.VirtualListViewRequestControl) for this purpose, but I think Active Directory only supports the simple paged results control.

     
    • Annapoorna

      Annapoorna - 2014-02-11

      Thank you so much Neil! I used LDAPEntrySource. It works!

       

Log in to post a comment.