Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Resource shortage error

0 Kudos

Hello experts,

I'm facing a runtime error - "Resource shortage, TSV_TNEW_PAGE_ALLOC_FAILED". I need to store all the data in the internal table, a regular LOOP won't let me do that. Is there a way I can achieve that? (Sharing an image of the dump as client system won't let me copy stuff)

Thanks in advance.

5 REPLIES 5

FredericGirod
Active Contributor
0 Kudos

This is an error related to the allowed size in memory.

If you absolutly need to have access to more memory space, ask the sys-admin to change the related instance parameters

0 Kudos

Hi Frederic,

The memory capacity is set to the max limit.

FredericGirod
Active Contributor
0 Kudos

so you have to check if all the data you store is needed or not

for example SELECT * INTO TABLE ... is consuming a lot of memory

you could also check the memories consumption in debug mode

RichB
Participant
0 Kudos

You need to be very specific in the fields you need and limit the data as much as possible. Another solution would be to create a "real" table (ie. ZTABLE1) that you could write the data to. Then work from that and be sure to delete all of the rows once you are done.

Tayane
Advisor
Advisor
0 Kudos

Hello Anuj and community!

The runtime error "TSV_TNEW_PAGE_ALLOC_FAILED" occurs when the result set being returned by the ODATA request exceeds the memory available to process the request or when the result set is significantly large and requires considerable time to assemble before being returned to the requestor.

This is not an issue with the CDS View but rather with ODATA. ODATA is an open standard and does support paging, for services executing an underlying CDS View which returns millions of rows of data, paging is recommended.

The following SAP Blog describes how to page throw the results of an ODATA request using the ODATA $top, $skip, and #count verbs: SAP Blog - Using OData’s $top, $skip and $count

You should use $top and $skip to fetch the data. You can also use the $count to determine how many records there are, to know how many requests are needed to get the full set.

This is the only way to limit the results to get all the data without causing the system to run out of memory. The other alternative here is to reduce the complexity of the CDS view such that the memory requirements on the system are not as severe.

Hope I could clarify things for you 🙂

Best regards,

Tayane.