cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

AMDP method works only in debugger (SQL Error 2048)

former_member747908
Discoverer
2,389

Hi, Experts!

I made a report which calls AMDP-method to obtain data from DB. But when I run it, I get a SQL Error 2048 (as I see, it is because of memory allocation error). I put a breakpoint in the AMDP-method, run report and when debugger has stopped, I press F8 and everything works fine. How can I make report working without debugger?

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor

One of the differences of debugger-mode vs. normal execution of HANA stored procedures is that the debugger runs in sequential "mode", while the normal execution can parallelize some actions.

This means that in normal "mode" there could be more memory usage at the same time.

Either way, you want to check what causes the out of memory errors and fix that as high memory consumption often goes hand in hand with slow performance.

former_member747908
Discoverer
0 Likes

Thank you, Lars! I found your answer on another question, where you suggested to try BEGIN SEQUENTIAL EXECUTION option. Yes, that helped me and now my report works without sql error. Also I'll try to optimize my AMDP-method.

0 Likes

Just to link this post with the solution you propose, here is a Blog post on how you can trace a AMDP AMDP Trace 

0 Likes

.

Answers (1)

Answers (1)

Former Member
0 Likes

Check the size of the MAXIMUM_SIZE_OF_ROW_STORE parameter. Make sure you have not exceed either the physical RAM, allocated RAM, or the size of the parameter. Keep in mind that columnar databases are an old type of legacy database that was replaced with relational databases more than 40 years ago because of these memory issues. Instead of finding data by unique identifiers, they search through all the data using columns on every execution. The size of the data in memory can easily exceed the physical RAM, allocated RAM, or the size of the parameter. IBM has this same issue with DASHDB/DB2 WAREHOUSE. It seems that the lessons of the past have been forgoten are being repeated in the present. To prevent the issue simply plan the size of the RAM and parameters to be larger than the largest possible execution or larger than your data times the number of concurrent users. Since SAP Hana S4 is an in-memory database that uses column store, it can exceed the size of the data. Also, you may want to check if the database can exceed the 32-bit memory limit of 2GB, the old limit from 40 years ago. Most of the legacy technologies have the legacy memory limitations. For example, a tabular database has a 2 billion minus 3 record limit. Some of the old columnar databases had a 2GB hard limit for the size of the query itself, or the return of the data from the query. Since this error is reproducible on every column store database, it's likely that HANA has the same limitation. (ERROR CODE 2048 = the old 32-bit 2GB memory limit of columnar databases). (See database history on Edgar F. Codd and ACID compliant databases systems) https://help.sap.com/viewer/7c78579ce9b14a669c1f3295b0d8ca16/Cloud/en-US/20a760537519101497e3cfe07b3...