Re: [xml] Memory leak problem

On Tue, 2019-11-26 at 11:47 -0700, Eric Eberhard wrote:
Is there a C call to see how much memory one is consuming?  I could
likely put that in to try and find it.

Depends on your operating system - there are also environment variables
you can se that affect the bahaviour of malloc() in various ways, and
that may help you. Try malloc_info() maybe,
   int malloc_info(int options, FILE *stream);
where options must be 0 (duh).

If you don't have that, malloc_stats() prints to stderr, and if you
don't ahve that, mallinfo() returns a struct.

On some systems, getrusage() will tell you about your process or
thread's memory usage. Some other systems have vtimes() instead.

There's a variety of C debugging tools, but it depends on the operating
system and environment as to which will be available.

It might be that a change in some external library has moved something
around in memory and exposed a bug in your code (or in someone else's).

Incidentally, for production work, it's worth considering moving to an
XSLT 3 engine - whether Saxon 9 (Java, C# and C) or another one.

In a recent class exercise (in a course i was running on XSLT 3) people
reported times of 6 seconds or so to write 10,000 HTIL files from an
XML input document, and 10 seconds to do the same in streaming mode.
This was using Saxon EE in Java, for what it's worth. So it might be
acceptably fast that you can consider moving to XSLT 3 and get the
engineering benefits of type checking, too.


Liam Quin,
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]