cancel
Showing results for 
Search instead for 
Did you mean: 

Big memory consumption XSLT, why Heap is used? Best with ST.

Sandra_Rossi
Active Contributor
318

I've got an XSLT transformation (not ST) which converts a big ABAP internal table into XML (serialization). It did a short dump SYSTEM_NO_ROLL due to something like 4 GB memory needed. 

Here's the memory consumption in the short dump:

Sandra_Rossi_2-1744832590024.png

I can reproduce the issue in my DEV system with a small test program with dummy data:

Sandra_Rossi_5-1744832979935.png

I can solve the issue by creating an equivalent ST transformation, which is consuming less memory (below), and is also 10 times faster.

Sandra_Rossi_4-1744832835706.png

If I reduce the volume, XSLT is successful, but I see that it's consuming the HEAP memory (which I guess is bad),

Sandra_Rossi_0-1744832146834.png

while ST is not consuming it.

Sandra_Rossi_3-1744832786402.png

My question is, I'd like to understand why the Heap memory is consumed by XSLT although the total memory is not so much solicited (284 MB + 631 MB) and there's no other activity in the system, so I'm interested by any information.

EDIT: more information added below.

Initial screen of RSMEMORY:

Sandra_Rossi_0-1745416597419.png

SM50:

Sandra_Rossi_1-1745416634784.png

Here's an animated GIF of maximum memory consumption by XSLT (+ its source and target data) for around 50 seconds, going from second 52 to second 42, the heap memory is immediately used:

ABAP XSLT memory.gif

Here's an animated GIF of maximum memory consumption by ST (+ its source and target data) for around 40 seconds, from second 36 to second 16, the heap memory is immediately used too:

ABAP ST memory.gif

Here's the source code of ABAP and transformations: sandraros/test-xslt-memory (installation via abapGit/abapGit: Git client for ABAP).

Thank you.

Sandra

System: ABAP 7.40 SP 23; Kernel 753 PL 1300.

NB: I guess that Heap is bad because the workprocess becomes PRIV, so it cannot be reused by other ABAP tasks, and it's especially a problem if the program is running in a DIA workprocess. I don't know for BGD workprocess (my case).

NB: for generating the XSLT short dump, the internal table contains more than 260.000 lines, 20 fields of total 1032 bytes, including characters (Unicode 2 bytes), packed, NUMC, dates, no references, and two nested internal tables, the first one containing 1 line (always) and having 4 fields of total 186 bytes, the second one containing 1 line (always) having 20 fields of total 616 bytes including one nested internal table containing 1 line (always) having 4 fields of total 36 bytes. Via the ST transformation, the generated XML file is 413 MB.

 

Accepted Solutions (0)

Answers (2)

Answers (2)

Ryan-Crosby
Active Contributor

Hi Sandra,

I think it has to do with the following as described in the help for simple transformation - 

  • ST programs only have serial access to the XML data and are therefore very efficient even with large data volumes. The nodes in XML data, however, cannot be accessed in an arbitrary order.

In the help reference to XSLT in the same link it displays a diagram showing the asXML intermediate format when XSLT is used along with a basic description of the processing, which I would assume would account for additional memory usage (both links included below).

Screenshot 2025-04-16 at 16.30.25.png

ST and XSLT links

 

Regards,

Ryan Crosby

Sandra_Rossi
Active Contributor
0 Kudos
Thanks. Yes, ST is about 10 times faster than XSLT (rule of thumb). XSLT should be used only for stuff which cannot be done via ST. My question seems to be the first one giving information about the memory used by XSLT versus ST. But my question is more about Heap and memory in general, I'd like to understand why Heap is used although EM is only few hundreds of MB and no other task in the system.
jmodaal
Active Contributor
0 Kudos
Sandra_Rossi
Active Contributor
0 Kudos
No. Will it trace inside XSLT? (basic transformation, no method call) Do you think it will help me understand why the Heap memory is consumed by XSLT although the total memory is not so much solicited and there's no other activity in the system?
jmodaal
Active Contributor
0 Kudos

Hello,

I do not know whether it may help you. It is just the first approach coming to my mind when it is about memory problems.

Kind regards

Jan