DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43942>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43942


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21240|0                           |1
        is obsolete|                            |
         AssignedTo|[email protected]       |[EMAIL PROTECTED]
             Status|NEEDINFO                    |ASSIGNED




------- Additional Comments From [EMAIL PROTECTED]  2007-12-07 05:01 -------
Created an attachment (id=21242)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21242&action=view)
Patch - optimized attribute handling

Regardless of the process doesn't crash anymore with correct LDR-CNTRLs I still
 think that this is bug in util_ldap.c

If you look at this piece of code:

-            while (values && values[j]) {
-                str = str ? apr_pstrcat(r->pool, str, "; ", values[j], NULL)
-                          : apr_pstrdup(r->pool, values[j]);

So with each iteration an new string is allocated with apr_pstrcat whereas the
old string is not returned to the pool.

In my case I want to retrieve 3'500 attribute values. So this loop has 3'500
iterations and 3'500 strings are allocated, each a bit larger than the one
before. This is exponential memory consumption.

In the end this loop consumes about 760 mb; in my patched version it takes only
about 800 kb. Still not optimal, but much better than before.

Patch now in unified diff format as requested.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to