cancel
Showing results for 
Search instead for 
Did you mean: 

Insufficient heap memory

former_member89972
Active Contributor
0 Kudos

Hello folks

We are in process of testing ASE 16 (process kernel), on AIX, upgrade from ASE 15.5

Adaptive Server Enterprise/16.0 SP02 GA/EBF 24949 SMP/P/RS6000/AIX 7.1/asecorona/2425/64-bit/FBO/Thu Aug 13 00:15:32 2015

to be exact.

During testing developers have faced insufficient heap memory errors.


We have tried to keep matching server configurations from ASE 15.5 to ASE 16.

Our server page size is 8K.  Connections 850 worker processes 10.

Current per user heap memory is 3.5 times the page size.


--Works (both ASE 16 and ASE 15.)

DECLARE @s char(288)

set @s=''

select str_replace(@s,'','')

--Doesn't work on new ASE 16 but works on the older ASE 15.5 server

DECLARE @t char(289)

set @t =''

select str_replace(@t,'','')


Exact run is below


1> DECLARE @t char(289)

2> set @t =''

3> select str_replace(@t,'','')

4> go

(1 row affected)

Msg 712, Level 17, State 6:

Server 'PHI5_DEV', Line 3:

There is insufficient heap memory to allocate 289 bytes. Please increase configuration parameter 'heap memory per user' or try again when there is less activity on the system.

1> quit

The threshold numbers 288 and 289 were discovered  by the developers after a few attempts.

If I use numbers higher than 289 the error is same,  only the "allocate XXX bytes" part changes.

I have opened a case with SAP.

Creating this discussion in hope getting some more feedback from user community too.

Question : When a SPID hits the Msg 712 error, does it release the heap space back to pool ? or the heap state is undefined for that SPID ?

I know ASE 16 monProcessActivity has some columns related to heap. How can we effectively use these to monitor/calibrate heap usage ?

TIA

Avinash

Accepted Solutions (1)

Accepted Solutions (1)

c_baker
Employee
Employee
0 Kudos

Why are you using "Process" Kernel instead of "Threaded" Kernel?  You should be using "Threaded" Kernel.

Chris

former_member89972
Active Contributor
0 Kudos

Thanks for pointing out the obvious

Long story ....

But the gist is constraints of resources and time to test the apps and monitoring thoroughly !

So we want to migrate to ASE 16 with minimum surprises.

And hopefully we will get to test the threaded mode before we upgrade it in place.

BTW : Feedback from SAP so far is that there is a heap memory pool fragmentation occurring. We are investigating further to find the cause(s).

Avinash

c_baker
Employee
Employee
0 Kudos

It's shot in the dark, (and you are using process mode, not kernel mode), but a long time ago, when putting ECC on ASE, we found similar 712 errors (see the Best Practices 1.4b doc attached to SAPNote 1680803).

The short story is - try increasing the number of user connections (by an additional 20% - according to the document).

Sounds strange, but possibly worth a shot.

(Don't ask me for an explanation.  Rummaging through my memory can have adverse side-effects).

Chris

former_member89972
Active Contributor
0 Kudos

Chris

Thanks for the link.

Increasing number of connections is one of the options by which we will get bigger heap memory pool at the reboot of ASE server. And apart from increasing per process memory I may just do this as temporary measure.  (more details below)

Anyway in our case it turned out to be a bug in ASE 16 SP02

It was not there in 15.5 or 15.7.

Underlying cause is a login trigger we use to set up two variables with use of set app_context.

Use of set app_context fragments the heap memory pool severely. And that leads to error 712 finally.

Most likely we will request a one off for this.

Cheers.

Avinash

former_member182259
Contributor
0 Kudos

Rather than increasing the number of connections, I would suggest increasing the config 'heap memory per user'.   The default is 4K in ASE 16sp02 - I generally recommend 16KB.  If performing XQUERY functions (xmlextract, etc.), I suggest a minimum of 64KB.

But yes, you should get an N-off for the fix - but in the meantime, you might want to bump up heap memory per user to 16KB or 32KB.   Increasing number of connections - while possibly has a similar affect on heap pool size - also requires extra memory for other structures (e.g. ULC, etc.) and may require more memory vs. simply increasing the heap memory per user.

former_member89972
Active Contributor
0 Kudos

Thanks for your feedback.

I have done that (i.e. increase heap per process to 32 KB).  Will watch this for some time.

Increasing number of connections is next possible option if need be.

Both lead to increased heap memory pool at server reboot.

Thanks

Avinash

Answers (2)

Answers (2)

former_member89972
Active Contributor
0 Kudos

FYI all

A new KBA is released for this.

Work arounds till we got the a one-off build were :

- increase the heap memory per process (in small steps)

- recycle the server almost everyday to reset the heap memory pool

Fortunately for us this was discovered in a non-production enevironment so the impact was limited.

2324155 Error 712 State 6 Insufficient heap memory error

HTH

Aviansh.

former_member187136
Contributor
0 Kudos

Dear Avinash,

Hope this SAP Note gives you some hints on the"Heap Memory"

1968888 - How to monitor 'heap memory' usage in ASE ? 

Do let me know if it helps ?

Regards

Kiran K Adharapuram

former_member89972
Active Contributor
0 Kudos

Thanks Kiran

Before creating this discussion, I had run the queries mentioned in the SAP note to check how heap memory is being used.  Of course that was the starting point any way.

Per SPID figures are available from the MDA table.

I also need to find fragmentation of heap pool and SPIDs that my be causing that.

Any way I have opened the case as well. So let us see this goes.

Thanks

Avinash

former_member187136
Contributor
0 Kudos

Hi Avinash,

Wow Nice

Do let us once you get updates for your case

Regards

Kiran K Adharapuram