1. A method for monitoring memory usage, the method comprising: detecting an indication of a memory leak in an application, the application being a directory server according to a directory access protocol and operating in a data processing system and using a memory associated with the data processing system, wherein the indication is responsive to determining that (i) a rate of growth of memory space allocated to the application exceeds a threshold rate of allocation at a first time, and (ii) an unused portion of the memory space allocated that is freed at a second time exceeds a threshold amount; receiving, responsive to the detecting, from a client application of the directory server using an interface to a memory monitoring component in the application, an instruction to begin monitoring a memory usage of the application to invoke a first extended operation to execute monitoring on-demand in the directory server; beginning, responsive to receiving the instruction to begin, monitoring the memory usage of the application, wherein the memory monitoring component in the application performs the monitoring; receiving an instruction to dump a data related to the monitoring causing a second extended operation to execute on-demand in the directory server; dumping the data, responsive to receiving the instruction to dump; receiving an instruction to end the monitoring causing a third extended operation to execute on-demand in the directory server; ending the monitoring, responsive to receiving the instruction to end, wherein the detecting, the beginning, the dumping, and the ending occur while the application remains in operation and while the application uses the memory; and confirming using the data the memory leak.