2
votes

I made an ODBC connection to an Informix database. While doing a load test for the db, it gives an error "not enough space for parser stacks" after ~12K insert queries. The control flow is:

  1. SQLConnect
  2. SQLAllocStmt
  3. SQLSetStmtAttr
  4. SQLBindParameter
  5. SQLPrepare
  6. SQLExecute
  7. SQLFreeStmt
  8. Repeat step 2 to 7

Therefore, a new statement handle is allocated for each query while all the queries are performed over the same connection. The exact error statement is:

37000:[Informix][Informix ODBC Driver]General error. Not enough space for parser stacks

Is it a known error? I am not able to locate any memory leak also. Increasing size of stack may end up causing the same problem after a larger number of 'insert' queries. Any suggestion?

1
Show us your version of Client SDK and tell us more about your OS and environment.Michał Niklas
The problem is pretty much guaranteed to occur sooner or later, even with an increased heap size. It is not immediately obvious that the heap in question is the main malloc() heap or any equivalent; it may be localized to the 'parser' inside the ODBC driver. It sounds to me as though the driver is parsing the statements, and not quite releasing all the space after doing so. I'd suggest ensuring you are on a recent version of CSDK (3.70.xC4 would be good), and if the problem occurs there, then report the problem to IBM Technical Support.Jonathan Leffler

1 Answers

1
votes

Do you load database with various ~12K different insert statements?

If not then you do not need to do all that API calls. Instead repeating steps 2 to 8, for the same INSERT statement you can repeat steps 4, 5 and 6. This way you will have one PreparedStatement for each table. Do not create PreparedStatament for each row you are going to insert. I think that if you change your load program to work this way, the error may disappear.

Also you can show us version of your ClientSDK, and tell us more about your OS and environment.