Hello,
I found a memory leak in WrapperManager.listServices().
The problem seems to be in the windows native code.
The attached program will demonstrate the leak.
The java heapsize won't grow but the Memory-size in
the taskmanager will grow and grow.
I'm using:
Microsoft WindowsXP
Java Service Wrapper 3.2.3
Maybe it's this: (I'm no expert C-programmer anymore)
In the native code I see on line 823:
services = malloc(size);
This structure is never 'freed'.
Logged In: NO
I forgot to mention the file which I think has the memoryleak:
./src/c/wrapperjni_win.c
Logged In: NO
I can confirm that the line 823 in wrapperjni_win.c is indeed the memoryleak.
I compiled the library on windows and ran "Test5.java" again (see attached) and
it showed no memoryleak anymore in the taskmanager.
The solution was to add the following code just before 'CloseServiceHandle(hSCManager)' :
if(services != NULL) {
free(services);
}