Your piece of code looks good.
How much of memory get lost per call? Size if buffer obtained via
SablotGetResultArg? More or less?
Is memory returned after destoying of processor? (SablotDestroyProcessor).
Do you reuse the created threads (probably using some events etc.) or do
you create new thread per call? Processor is destroyed when thread is
gone? Note, that processor holds memory allocated for buffers until next
call to RunProcessor resp. DestroyProcessor.
Of course, there may be a bug in Sablotron engine.
Can you send us a sample data?
[EMAIL PROTECTED] (Sven Neumann) wrote:
> Hi,
>
> I'm excessively using Sablotron in a threaded application
> and there's obviously a memleak somewhere. The XSLT processing
> is the only operation using the amount og memory I'm leaking,
> so I guess I'm doing something wrong when using the XSLT
> processor. Here's the relevant snippet of code. Please tell
> me if I'm doing something wrong here:
>
>
> char *
> message (char *xml,
> SablotHandle processor)
> {
> char *result;
> char *message;
> char *argums[] =
> {
> "/_stylesheet", stylesheet,
> "/_xmlinput", xml,
> "/_output", NULL,
> NULL
> };
>
> SablotRunProcessor (processor,
> "arg:/_stylesheet",
> "arg:/_xmlinput",
> "arg:/_output",
> NULL,
> argums);
> SablotGetResultArg (processor, "arg:/_output", &result);
> message = strdup (result);
> SablotFree (result);
>
> return message;
> }
>
>
>
> The processor is created outside the function. It is used
> several times and destroyed when finished. Each thread
> creates its own processor. Of course the string returned
> by message() is freed once it is no longer needed.
>
>
> Salut, Sven
--
Pavel Hlavnicka
Ginger Alliance Ltd.
Prague; Czech Republic