cancel
Showing results for 
Search instead for 
Did you mean: 

Huge memory allocation

Former Member
0 Kudos

Heloo guys,

I have the following system: Linux SLES 10 (x86_64) / Oracle 10.2.0.4.0 - RAC / SAP ECC 6.0 Kernel Patch 221

Memory in the system reported by the utility "top" is 39116504k.

Considering that the memory used by Oracle is determined by the formula 1 * SGA + sum (PGA) i have executed the following select: "select (sga+pga)/1024/1024 as "sga_pga" from (select sum(value) sga from v$sga),(select sum(PGA_ALLOC_MEM) pga from v$process)" and the result was : 15642.2719268799

About the memory occupied by SAP I looked at the parameter em/initial_size_MB = 8000. Where in transaction st02 to "SAP Memory" - "Extended Memory" I have

"In Mem[KB]"= 8.187.904,

"MaxUse[KB]" = 4.558.848,

"CurUse[KB]"= 2.768.896

So let's say that for SAP and Oracle i have 8000 MB + 15643 MB = 23643 MB

But utility top and utility free reports the same thing=>

Mem: total=39116504 used=38806160 free=310344

and Swap: total=20972848 used=601552 free=20371296

I looked on top in a sort after Memory Usage:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

20021 oraprd 16 0 14.9g 12g 12g D 8 34.4 206:37.97 oracle

19896 oraprd 16 0 14.6g 12g 12g S 14 33.7 226:08.87 oracle

19894 oraprd 16 0 14.4g 12g 12g D 3 33.4 265:10.75 oracle

......

And the list of processes that uses over 30% of memory is much longer.

Honestly, 30% from memory used (about 11.4 Gb / session) seems to me very much!

Consequently I took a look in transaction st04 "Session Monitor"and we have identified (by PID)

first session of the top , as a session with inactive status. We also identified the number of Workprocess and noticed that it does not run anything in transaction sm50. I checked in sm21 and st22, for an error that give me an idea, but nothing.

I also noticed that if I go to sm50 and give "Cancel with core" in the process, the process restarts and memory-level operating system is released.

So, I guess, I have a memory issue, ... but not sure.

Can help me someone to understand what is happening there and why this happens?

Can i ? and how to put a limit for memory allocation for process, then that process to restart automatically to release the memory?

Thanks a lot,

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Well, this is quite complicated, let me give you another view first: you don't have a memory issue, unless you experience swapping. If that happens your system will be very slow, and you can see high disk activity and the kswapd processes using cpu.

You need to know that linux does automatically use free memory as filesystem cache, so it is very common, that there is no free memory. Use the os command free to see the details:

mho $ free
             total       used       free     shared    buffers     cached
Mem:      24522636   24436912      85724          0     513576    6683712
-/+ buffers/cache:   17239624    7283012
Swap:     49151984    1812044   47339940

In my example the whole 24gb are used, but approx. 7gb are filesystem cache, meaning technically free.

The reason you see a lot of processes using 30% of memory is, that they are using shared memory, so top does not show that correctly. The two big shared memories are the SAP extended memory (EM) and oracle SGA.

Setting rdisp/wp_auto_restart will only free heap memory (process local) memory, but not the shared memory from the EM. We use a setting of 24h on some systems, personally i like it and there is practically no disadvantage.

So remember if you don't experience high swapping resulting in huge system slowdowns, you don't have a memory issue yet.

Cheers Michael

Former Member
0 Kudos

heloo mho,

Thanks, very useful information. Indeed, we have more free memory in cache.

free -m

total used free shared buffers cached

Mem: 38199 37847 352 0 408 30280

-/+ buffers/cache: 7158 31041

Swap: 20481 161 20319

However, this car has done the swap, and everything moved slowly... but I have not watched if I had some free in the cache ...

Anyway I think I kinda understand, even for the most part, what happened to that memory load ...

But what you said about shared memory made me think.

My configuration is this: I have 2 machines, each has one sap instance and one Oracle instance ,with less RAM, which we defined em / initial_size_MB = 7000. we also have 2 other cars, each with an SAP instance, with more memory,where we defined em/initial_size_MB = 52000.

So in total we have 4 instances: 2 instances with em/initial_size_MB = 7000 and 2 instances with em/initial_size_MB = 52000.

My problem is appeared on instances with em/initial_size_MB = 7000 where on OS level where we 38Gb RAM.

In this situation, em/initial_size_MB=52000 on the machine with more ram , may affect shared memory on the machine with less RAM?

Regards

Former Member
0 Kudos

In this situation, em/initial_size_MB=52000 on the machine with more ram , may affect shared memory on the machine with less RAM?

Absolutely no, shared memory is not shared between different servers. So for example if you increase the EM on server1, this does not have an effect at all on server2. The memory is only shared for the work processes on server1.

Cheers Michael

Former Member
0 Kudos

Hi

Thanks for the support provided.

We changed the parameter in the test and after careful monitoring will implement in production.

I also found the note "Note 158346 - Periodically restart of work processes.

Regards.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

I found the parameter sap rdisp / wp_auto_restart = 0. If I change parameter rdisp / wp_auto_restart to 2h to say, do you think would be able to solve this problem?

Regards