SlideShare a Scribd company logo
1 of 89
Oracle, Memory & Linux
Presented by: Christo Kutrovsky
Who Am I
•

Oracle ACE

•

12 years in Oracle field

•

Joined Pythian 2003

•

Part of Pythian Consulting Group
•

2

Performance tuning

•
•

Special projects

•

“oracle pinup”

Critical services

Presenter at: IOUG, RMOUG, UKOUG, OpenWorld

© 2013 Pythian - Presentation for OakWorld
Pythian
Pythian provides services to companies and
organizations that are dependent on data

© 2013 Pythian - Presentation for OakWorld
©The Pythian Group
Pythian Facts
•
•
•
•
•
•
•
•
•
•
•

Founded in 1997, over 15 years as a profitable, private company
200 employees and growing
200 customers worldwide, 34 customers more than $1 billion in
revenue
5 offices in 5 countries
Employ 8 Oracle ACEs (Including 2 ACE Directors) and 2 Microsoft
MVPs
Platinum level partner in the Oracle Partner Network
Gold level partner in the Microsoft Partner Network
Winner of 2011 Oracle Partner Network Titan Award
Ranked among Canada‘s Fastest Growing Companies in the Profit
200 in 2010, 2011 & 2012
Ranked in the Top 250 Canadian ITC Companies in Branham300
Average response time to alerts under 5 minutes

© 2013 Pythian - Presentation for OakWorld
Why Pythian
Recognized Leader:
•

Global industry leader in data infrastructure managed services and consulting with
expertise in Oracle, Oracle Applications, Microsoft SQL Server, MySQL, big data and
systems administration

•

Work with over 200 multinational companies such as Forbes.com, Fox Sports, Nordion
and Western Union to help manage their complex IT deployments

Expertise:
•

One of the world‘s largest concentrations of dedicated, full-time DBA expertise.
Employ 8 Oracle ACEs/ACE Directors

•

Hold 7 Specializations under Oracle Platinum Partner program, including Oracle
Exadata, Oracle GoldenGate & Oracle RAC

Global Reach & Scalability:
•

24/7/365 global remote support for DBA and consulting, systems administration,
special projects or emergency response

© 2013 Pythian - Presentation for OakWorld
Agenda
• Types

of Physical Memory
• Virtual Memory
• Types of memory
• How to monitor memory usage
• Oracle specifics
• HugePages effect
• Oracle Views

6

© 2013 Pythian - Presentation for OakWorld
Types of memory

8
It’s all memory
•

CPU registers

•

CPU Cache L1

•

CPU Cache L2

•

CPU Cache L3

•

Main Memory (RAM)
•

Remote memory in NUMA

•
•

Magnetic Storage (―DISK‖)

•

9

SSD Cache (*new*)
Tape

© 2013 Pythian - Presentation for OakWorld
The Difference
•

CPU registers

•

CPU Cache L1

•

CPU Cache L2

•

CPU Cache L3

•

Main Memory (RAM)
•

PERFORMANCE

Remote memory in NUMA

•
•

Magnetic Storage (―DISK‖)

•

10

SSD Cache (*new*)
Tape

© 2013 Pythian - Presentation for OakWorld
What is PERFORMANCE
• Performance

is defined by:
• Latency – the amount of time from data
request to data receive
• Bandwidth – how much data can flow in best
case scenario
• Cost – pure $$$

11

© 2013 Pythian - Presentation for OakWorld
Memory Hierarchy
CPU
Registers
L1/L2/L3
CACHE
RAM
SSD
Disk
12

© 2013 Pythian - Presentation for OakWorld
Different memory – Intel i7
• CPU

registers –128 bytes / 0.3* ns (1 cycle)
• CPU Cache L1 – 64 KiB / 1.2* ns
• CPU Cache L2 – 256 KiB / 3.0* ns
• CPU Cache L3 – 12 MiB / 12* ns
•

Local core (1.0x), remote core (1.6x), dirty (1.9x), remote (4x)

• Main
•

Memory (RAM) – 1 TiB or more / 60 ns

Remote RAM (multi-socket) – 100 ns

• SSD

Cache (*new*) – Any / 60,000 ns
• Magnetic Storage (―DISK‖) – Any / 3,000,000 ns
http://www.tomshardware.com/reviews/Intel-i7-nehalem-cpu,2041-10.html
http://software.intel.com/sites/products/collateral/hpc/vtune/performance_analysis_guide.pdf

13

http://en.wikipedia.org/wiki/Memory_hierarchy

*CPU Cache time measured for 3.3 Ghz CPU
© 2013 Pythian - Presentation for OakWorld
Scaled to real life
• CPU

Registers – 0.3 seconds your hands
• CPU Cache – 3 seconds your desk
•

L3 cache is your desk drawer – 12 sec (48 sec if locked)

• RAM

– 60 seconds - the storage room in the
basement
• SSD – 16.6 Hours
• Disk – 34 days
•

14

Used to be 8 hours

© 2013 Pythian - Presentation for OakWorld
Memory Hierarchy – To Scale
CPU
Registers
1x

L1

L2

L1/L2/L3 CACHE
4x -> 2.5x -> 4x (16x)
512-> 4x -> 48x (192x)

L3
RAM (256 GiB)
Latency = 5x
Size = 22,000x

15

© 2013 Pythian - Presentation for OakWorld
Memory Hierarchy – To Scale 2

L3 CACHE
4x (16x)
48x (192x)

RAM
Latency = 5x
Size = 22,000x
SSD (4 TiB)
Latency =1,000x
Size = 16x

DISK (100 TiB)
Latency = 50x
Size = 25x
16

© 2013 Pythian - Presentation for OakWorld
RAM
• Not
•

so significant latency implication

4x -> 2.5x -> 4x -> 5x -> 1000x -> 50x

• Significant
•

512x -> 4x -> 48x -> 22,000x ->16x ->25x

• Your
•

17

size up compared to previous layers

most important cache

It‘s a cache because it‘s still volatile

© 2013 Pythian - Presentation for OakWorld
Virtual Memory

18
How a computer works
• Read
•

instructions from memory

In the old days it was from a cassette or even paper punch cards

• Execute

instructions, which read some more

memory
• Produce results
• stores them in memory
• display them Paper or Screen
•

19

(or sound)

© 2013 Pythian - Presentation for OakWorld
How we use a computer
• Do

many things

•

•

Expect them to run unaware of each other

•

20

Run multiple applications at the same time
One application must in no way interfere with another

© 2013 Pythian - Presentation for OakWorld
Virtual Memory attempts to abstract the
‗read/write‘ concept and just work with
―memory‖

21

© 2013 Pythian - Presentation for OakWorld
The Goal of Virtual Memory
• Write

programs that do not directly depend on
the amount of RAM
• More RAM available – program runs faster
• Simplify memory management
• Run independently, safely
• OS controls what stays in RAM and what and
when is evicted
• Optimal file cache usage

22

© 2013 Pythian - Presentation for OakWorld
VM Offers
• Protection
• Independent

memory space

• Features
• read/write/execute

permissions
• maximize memory reuse/sharing
• mmap – memory mapped files – work with
files as if they were ―loaded‖ in memory
• allocate more memory than available

23

© 2013 Pythian - Presentation for OakWorld
VM Visualized
oraclegcdw1
0 Gb
155Mb

27 Gb
26’000 Mb

12

/…/11.2.0/dbhome_1/bin/oracle
PID USER
23235 oracle

/lib64/librt-2.5.so

4 Mb
Oracle’s SGA

Data

4
P
T
E

PR NI VIRT RES SHR S %CPU %MEM
TIME+ COMMAND
16
0 25.7g 546m 202m S 63.9 0.8 308:51.92 oraclegcdw1 (LOCAL=N

cat /proc/pid/status
…
VmPeak: 26898012 kB
VmSize: 26898012 kB
VmLck:
0 kB
VmHWM:
559248 kB
24
VmRSS:
559248 kB

VmData:
VmStk:
VmExe:
VmLib:
VmPTE:

5032
96
155348
12260
4328

kB
kB
kB
kB
kB

© 2013 Pythian - Presentation for OakWorld
VM Visualized
oraclegcdw1
27 Gb

0 Gb
155Mb

26’000 Mb

12

/…/11.2.0/dbhome_1/bin/oracle

/lib64/librt-2.5.so

Loaded from disk
i.e.
copied from slower memory
© 2013 Pythian - Presentation for OakWorld

4 Mb
Oracle’s SGA

Data

“Anonymous”
i.e.
not copied

4
P
T
E
VM Memory types
• Two

types of memory
• With a disk representation
• Without a disk representation
•

26

Depends on on OS it‘s called ―Anonymous‖, ―computed‖ and other
names.

© 2013 Pythian - Presentation for OakWorld
VM Visualized
23235 oraclegcdw1
27 Gb

0 Gb
155Mb

26’000 Mb

12

/…/11.2.0/dbhome_1/bin/oracle

/lib64/librt-2.5.so

4 Mb
Oracle’s SGA

Data
Data

155Mb
0 Gb

12

26’000 Mb

23184 oraclegcdw1
© 2013 Pythian - Presentation for OakWorld

4 Mb
27 Gb

4
P
T
E

4
P
T
E
VM Memory types
• Shared
• everything

from disk
• IPC shared memory segments
• Private
• Anonymous memory
• ―copy on write‖

28

© 2013 Pythian - Presentation for OakWorld
/proc/meminfo
cat /proc/meminfo
Buffers:
613
Cached:
38 120
SwapCached:
10
Active:
35 034
Inactive:
12 114
HighTotal:
HighFree:
LowTotal:
74 027
LowFree:
22 744
SwapTotal:
16 771
SwapFree:
16 761
Dirty:
9
Writeback:
AnonPages:
8 402
Mapped:
18 820
Slab:
1 165
PageTables:
2 620

29

944
544
748
160
512
0
0
752
448
852
104
656
0
424
948
376
300

kB
kB Copied from Disk
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
NOT from Disk
kB
kB
kB
VM Metadata

© 2013 Pythian - Presentation for OakWorld
VM Table
Shared

Anonymous

SGA

Data

From Disk

30

Private

Binaries, libs

© 2013 Pythian - Presentation for OakWorld
VM Table
Shared

Private

Anonymous

SGA*

Data

From Disk

Binaries, libs

*HugePages is different
31

Cached
© 2013 Pythian - Presentation for OakWorld

AnonPages
/proc/meminfo
cat /proc/meminfo
Buffers:
613
Cached:
38 120
SwapCached:
10
Active:
35 034
Inactive:
12 114
HighTotal:
HighFree:
LowTotal:
74 027
LowFree:
22 744
SwapTotal:
16 771
SwapFree:
16 761
Dirty:
9
Writeback:
AnonPages:
8 402
Mapped:
18 820
Slab:
1 165
PageTables:
2 620

32

944
544
748
160
512
0
0
752
448
852
104
656
0
424
948
376
300

kB
kB File System Cache, Binaries
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
Private Data, Stack, etc.
kB
kB
kB
VM Metadata

© 2013 Pythian - Presentation for OakWorld

Oracle SGA

Oracle PGA
/proc/meminfo - hugepages
cat /proc/meminfo
Buffers:
493
Cached:
10 093
SwapCached:
Active:
11 311
Inactive:
1 821
HighTotal:
HighFree:
LowTotal:
82 450
LowFree:
3 202
SwapTotal:
2 097
SwapFree:
2 093
Dirty:
Writeback:
AnonPages:
2 636
Mapped:
138
Slab:
482
PageTables:
47

33

232
112
0
344
104
0
0
640
516
144
676
580
0
020
272
468
132

kB
kB
File System Cache, Binaries
kB
Oracle SGA
kB HugePages_Total: 32000
8980
kB HugePages_Free:
1197
kB HugePages_Rsvd:
kB
kB
kB
kB
kB
kB
kB
kB
Private Data, Stack, etc.
Oracle PGA
kB
kB
kB
VM Metadata

© 2013 Pythian - Presentation for OakWorld
/proc/meminfo – example 2
cat /proc/meminfo
Buffers:
654
Cached:
37 806
SwapCached:
101
Active:
34 262
Inactive:
9 524
HighTotal:
HighFree:
LowTotal:
74 027
LowFree:
20 683
SwapTotal:
16 771
SwapFree:
16 670
Dirty:
14
Writeback:
AnonPages:
5 222
Mapped:
24 687
Slab:
1 371
PageTables:
7 843

34

908
532
112
824
280
0
0
752
044
852
740
328
0
736
736
528
932

kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB

File System Cache, Binaries

HugePages_Total:
HugePages_Free:
HugePages_Rsvd:

Oracle SGA

0
0
0

Private Data, Stack, etc.
VM Metadata

© 2013 Pythian - Presentation for OakWorld
Oracle’s SGA
• Without

HugePages
• In CACHED section
• With HugePages
• Not in CACHED section

35

© 2013 Pythian - Presentation for OakWorld
Oracle’s memory
Oracle memory
type

OS Location

OS Location
(HugePages)

*pool

SGA

Cached

-

*cache_size

SGA

Cached

-

Sort/Hash

PGA

AnonPages

AnonPages

PL/SQL variables,
arrays, workspace

UGA

AnonPages

AnonPages

Local cursor cache, UGA
workareas etc.

AnonPages

AnonPages

Bind variable data

UGA (+SGA)

AnonPages

AnonPages

Binaries

36

Oracle
location

-

Cached

Cached

© 2013 Pythian - Presentation for OakWorld
What is HugePages
•A

separate memory area that is
• Used only for shared memory segments*
• Non-swappable – locked in memory
•

Thus not managed by VM memory

• Managed

segments

37

in 2 Mb continuous memory

© 2013 Pythian - Presentation for OakWorld
What is HugePages
With
HugePages pool

Default

24 GB
RAM

72 GB RAM

48 GB
HugePages

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

38

2 MB

© 2013 Pythian - Presentation for OakWorld

2 MB
4K

2 MB

4K
4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

4K

2 MB

2 MB
VM Tricks – untouched memory
• Untouched

memory does not exists
• No PTE entires
• No memory consumed

39

© 2013 Pythian - Presentation for OakWorld
VM Tricks – untouched memory
cat grab.c
main() {void *p;
p=malloc(1073741824);
sleep(60);}
cat /proc/meminfo
...
MemFree:
3 230 592 kB
...
Committed_AS:
49 972 kB
./grab
cat /proc/meminfo
...
MemFree:
3 230 464 kB
...
Committed_AS: 1 098 808 kB

40

© 2013 Pythian - Presentation for OakWorld
VM Tricks – untouched memory
• What

does that mean for Oracle?
• Non-initialized SGA (db_cache) takes no
memory
• Untouched SGA by a new process consumes
no PTE entries

cat /proc/pid/status
…
VmPeak: 26 898 012 kB
VmSize: 26 898 012 kB
VmLck:
0 kB
VmHWM:
559 248 kB
VmRSS:
559 248 kB
41

VmData:
VmStk:
VmExe:
VmLib:
VmPTE:

5032
96
155348
12260
4328

© 2013 Pythian - Presentation for OakWorld

kB
kB
kB
kB
kB
VM Tricks - swap
• Memory

can be both swapped and not-swapped
• Only anonymous memory is swapped
•

Hugepages cannot be swapped, ever

• Linux

swaps recently unused memory in
anticipation of it‘s eviction
•

Only ―touched‖ memory needs to be swapped

• SwapCached

shows memory that exists in both
swap and RAM
• Actual swapping:
SwapTotal – SwapFree - SwapCached

42

© 2013 Pythian - Presentation for OakWorld
VM Tricks - OverCommit
• Linux

can allocate more memory that is
available
• Available = RAM + Total SWAP
• True ―out of memory‖ on linux very rare
• Controlled via
/proc/sys/vm/overcommit_memory
/proc/sys/vm/overcommit_ratio
• OOM Killer – Out Of Memory Killer
• A kernel thread that kills abusers

43

© 2013 Pythian - Presentation for OakWorld
VM Tricks – Solaris
• Solaris

is different
• VM Concept similar
• Difference in implementation
• No Overcommit
•

No OOM Killer

• All

anonymous pages MUST* have the
available swap, should they need to be
swapped
• Oracle‘s SGA is anonymous
* Unless using ISM

44

© 2013 Pythian - Presentation for OakWorld
VM Tricks – Solaris Pages
• Hugepages

are automatic

•
•

If available…

•

45

Multiple sizes: 64K, 2Mb, 64 Mb
Shutdown database, copy files, startup – uses more smaller
pages

© 2013 Pythian - Presentation for OakWorld
VM Tricks – Solaris ISM/DISM
• PTE

Tables are shareable
• ISM – Intimate Shared Memory
• Memory locked
• DISM – Dynamic Intimate Shared Memory
• Memory lockable
• Requires SGA size in available SWAP space
• If sga_max_size > sga_target
• DISM is used
• Needs ORADISM to run as root, to lock SGA
• And project limits relaxed
46

© 2013 Pythian - Presentation for OakWorld
Monitoring Memory

47
Linux memory tools
• Global
• /proc/meminfo
• vmstat
• Ipcs
• cgroups

(**)
• Per process
• top
• /proc/pid/status
• /proc/pid/maps
48

© 2013 Pythian - Presentation for OakWorld
Solaris memory tools
• Global
• prstat
• vmstat
• ipcs
• ―memstat‖
•

kernel debugger call

echo ―::memstat‖|mdb -k

• Per

process
• pmap -x

49

© 2013 Pythian - Presentation for OakWorld
prstat
PID USERNAME SIZE
RSS STATE PRI
23042 oracle
8134M 8079M cpu0
1027 oracle
122M
77M sleep
1254 oracle
8136M 8078M sleep
1069 oracle
74M
51M sleep
1007 oracle
119M
84M sleep
23032 root
4112K 3824K cpu46
23041 oracle
44M
14M sleep
23017 root
7544K 6240K sleep
1276 oracle
8134M 8077M sleep
1092 oracle
56M
42M sleep

50

NICE
0
59
59
49
59
59
59
59
59
59

0
0
0
0
0
0
0
0
0
0

TIME CPU PROCESS/NLWP
0:00:03 0.2% oracle/2
14:33:26 0.0% oraagent.bin/34
6:41:32 0.0% oracle/1
4:37:37 0.0% ocssd.bin/15
3:08:58 0.0% ohasd.bin/39
0:00:00 0.0% prstat/1
0:00:00 0.0% sqlplus/1
0:00:00 0.0% sshd/1
1:10:51 0.0% oracle/1
1:28:33 0.0% diskmon.bin/6

© 2013 Pythian - Presentation for OakWorld
Vmstat Solaris
• No

way to tell if the system is swaping or
writing to disk
• Vmstat –s ―so‖ and ―si‖ – always zero
• Best guess is a combination of non-zero ―sr‖
and ―po‖/‖pi‖ and activity on swap device

51

© 2013 Pythian - Presentation for OakWorld
Vmstat – Solaris
vmstat 2
kthr
memory
page
disk
faults
cpu
r b w
swap free re mf pi po fr de sr s0 s1 s2 s3
in
sy
cs us sy
3 0 0 15940984 1785088 8 23 0 5 5 0 0 10 28 7 5 8296 28180 10890 6 2
0 0 0 15411984 1412504 4 11 0 0 0 0 0 0 0 2 0 4487 1919 2483 0 0
0 0 0 15411664 1412248 0 1 0 0 0 0 0 0 0 1 0 4476 1530 2438 0 0
^C

id
92
100
100

vmstat -S 2
kthr
memory
page
disk
faults
cpu
r b w
swap free si so pi po fr de sr s0 s1 s2 s3
in
sy
cs us sy
3 0 0 15940968 1785080 0 0 0 5 5 0 0 10 28 7 5 8296 28179 10890 6 2
0 0 0 15411960 1412480 0 0 0 0 0 0 0 0 0 2 0 4446 1560 2410 0 0
0 0 0 15411640 1412224 0 0 0 0 0 0 0 0 2 1 0 4585 1898 2642 0 0

52

© 2013 Pythian - Presentation for OakWorld

id
92
100
100
Memstat (mdb)
bash-3.00# mdb -k
Loading modules: [ unix genunix specfs dtrace zfs sd mpt px ldc ip
hook neti sctp arp usba fctl nca lofs cpc random crypto fcip
logindmux ptm ufs sppp nfs ipc ]
> ::memstat
Page Summary
Pages
MB %Tot
--------------------------- ---------------- ---Kernel
215755
1685
11%
ZFS File Data
343278
2681
17%
File Cache
Anon
1214036
9484
59%
Oracle SGA
Exec and libs
52228
408
3%
Page cache
32394
253
2%
Free (cachelist)
66268
517
3%
Free (freelist)
118696
927
6%
Total
Physical

53

2042655
2011811

15958
15717

© 2013 Pythian - Presentation for OakWorld
ipcs / sysresv
• ipcs

–a (OS tool)
• Both Solaris and Linux
• Shows all Shared Memory Segments,
sempahors etc.
• ipcrm can remove orphan segments
• sysresv (Oracle tool)
• Reports semaphors and keys for current
ORACLE_SID

54

© 2013 Pythian - Presentation for OakWorld
ipcs
ipcs –a
------ Shared Memory Segments -------key
shmid
owner
perms
status
0x00000000 0
root
644
0x00000000 32769
root
644
0x00000000 65538
root
644
0xed304ac0 163844
oracle
660
0x466ff99c 557061
oracle
660

72
2
16384
2
280
2
4096
0
26845642752 182

------ Semaphore Arrays -------key
semid
owner
perms
0x869d3e0c 131073
oracle
660
0x869d3e0d 163842
oracle
660

nsems
125
125

55

© 2013 Pythian - Presentation for OakWorld

bytes

nattch
sysresv
sysresv
IPC Resources for ORACLE_SID "qadw1" :
Shared Memory:
ID
KEY
557061
0x466ff99c
Semaphores:
ID
KEY
2490378
0xd9773da4
2523147
0xd9773da5
2555916
0xd9773da6
...

56

© 2013 Pythian - Presentation for OakWorld
Linux /proc/meminfo
MemTotal:
MemFree:
Buffers:
Cached:
SwapCached:
Active:
Inactive:
HighTotal:
HighFree:
LowTotal:
LowFree:
SwapTotal:
SwapFree:
Dirty:
Writeback:
AnonPages:

57

74 027 752
20 683 044
654 908
37 806 532
101 112
34 262 824
9 524 280
0
0
74 027 752
20 683 044
16 771 852
16 670 740
14 328
0
5 222 736

kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB

Mapped:
24 687 736 kB
Slab:
1 371 528 kB
PageTables:
7 843 932 kB
NFS_Unstable:
0 kB
Bounce:
0 kB
CommitLimit: 53 785 728 kB
Committed_AS: 43 555 536 kB
VmallocTotal: 34 359 738 367 kB
VmallocUsed:
290 700 kB
VmallocChunk: 34 359 447 655 kB
HugePages_Total:
0
HugePages_Free:
0
HugePages_Rsvd:
0
Hugepagesize:
2048 kB

© 2013 Pythian - Presentation for OakWorld
Linux /proc/meminfo Newer
MemTotal:
MemFree:
Buffers:
Cached:
SwapCached:
Active:
Inactive:
HighTotal:
HighFree:
LowTotal:
LowFree:
SwapTotal:
SwapFree:
Dirty:
Writeback:
AnonPages:

58

16 344 972
13 634 064
3 656
1 195 708
0
891 636
1 077 224
15 597 528
13 629 632
747 444
4 432
0
0
968
0
861 800

kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB

Mapped:
Slab:
SReclaimable:
SUnreclaim:
PageTables:
NFS_Unstable:
Bounce:
WritebackTmp:
CommitLimit:
Committed_AS:
VmallocTotal:
VmallocUsed:
VmallocChunk:

© 2013 Pythian - Presentation for OakWorld

280
284
159
124
24

7 669
100
112

111

372
364
856
508
448
0
0
0
796
056
216
428
088

kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
kB
MemTotal
• Total

memory available to Linux
• Excludes reserved region
• If not what you expect – check the DIMM‘s. They
do occasionally die.

59

© 2013 Pythian - Presentation for OakWorld
MemFree
• Wasted

memory
• Memory not currently in use by anything
• May be removed from the system as it
provides no benefit
• Memory immediately available to be used by a
process touching memory
• Will be used by any non-directIO filesystem read
• Will be consumed until approaches
/proc/sys/vm/min_free_kbytes

60

© 2013 Pythian - Presentation for OakWorld
MemFree – example
grep MemFree /proc/meminfo
MemFree:
26 568 kB

echo 900000 > /proc/sys/vm/min_free_kbytes
grep MemFree /proc/meminfo
MemFree:
210 056 kB

61

© 2013 Pythian - Presentation for OakWorld
Buffers
• Cache

of raw disk blocks
• Usually occupied with ext3 metadata
• Mostly ext3 pointers (extent management)
• Not the cache of actual user data
• Should be relatively low (400Mb) on ASM
systems as filesystem metadata is inside ASM
• Unless filesystem used for backups, or other
data

62

© 2013 Pythian - Presentation for OakWorld
Cached
• Memory

that is copied from disk to RAM
• File system cache
• Binaries been executed
• Can be dirty i.e. Requires disk writes to be
released
• If not dirty, can be very quickly released when
programs request memory
• Will include the Oracle SGA if not using
hugepages

63

© 2013 Pythian - Presentation for OakWorld
Cached – example 1
[root@ ~]# cat /proc/meminfo
…
MemFree:
8232512 kB
Buffers:
9328 kB
Cached:
28372 kB
…
du -smc indx01_*
1714
indx01_01.dbf
1761
indx01_02.dbf
1722
indx01_03.dbf
5197
total
…

cat indx01_* > /dev/null

64

© 2013 Pythian - Presentation for OakWorld
Cached – example 2
[root@ ~]# vmstat 2
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---r b
swpd
free
buff cache
si
so
bi
bo
in
cs us sy id wa
0 0
0 8093888 10808 163392
0
0
0
0 1012
17 0 0 100 0
0 0
0 8093952 10808 163392
0
0
0
0 1012
16 0 0 100 0
0 1
0 7956736 10948 300272
0
0 68602
0 1567 1126 0 2 76 22
0 1
0 7808576 11092 448068
0
0 73992
80 1623 1210 0 2 75 23
…
0 1
0 2847616 16104 5397616
0
0 65792
0 1542 1076 0 2 75 23
0 0
0 2766272 16180 5479180
0
0 40698
0 1341
675 0 1 85 14
0 0
0 2766208 16192 5479168
0
0
0
114 1033
22 0 0 100
0
cat /proc/meminfo
…
MemFree:
2766464 kB
Buffers:
16192 kB
Cached:
5479168 kB
…

65

© 2013 Pythian - Presentation for OakWorld
Cached writing – example
cat indx01_* >newfile
vmstat 2
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---r b
swpd
free
buff cache
si
so
bi
bo
in
cs us sy id wa
0 0
0 2765312 17044 5479356
0
0
0
0 1012
17 0 0 100 0
0 3
0 2405376 17428 5833612
0
0
16 36866 1324
144 1 18 76 6
0 2
0 2143616 17688 6091532
0
0
4 111748 2000
213 0 16 50 34
…
0 1
0 16832
6784 8198556
0
0 8556 26684 1942 1267 0 2 74 24
1 1
0 16832
6856 8198744
0
0 12518 20720 2130 1767 0 3 74 23
…
cat /proc/meminfo
…
MemFree:
16768 kB
Buffers:
2192 kB
Cached:
8196908 kB
…
Dirty:
277468 kB
Writeback:
0 kB
…

66

© 2013 Pythian - Presentation for OakWorld
Cached removing file
cat /proc/meminfo
…
MemFree:
20672
Buffers:
3300
Cached:
8191900
…
Dirty:
0
Writeback:
0
…

kB
kB
kB
kB
kB

rm newfile
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---r b
swpd
free
buff cache
si
so
bi
bo
in
cs us sy id wa
0 0
0 23296
3380 8189480
0
0
0
28 1015
18 0 0 100 0
0 1
0 3257472
3948 4996372
0
0
284
0 1084
160 0 14 78 8
0 1
0 3255552
5828 4996572
0
0
940
0 1247
485 0 1 75 24
0 1
0 3253696
7616 4996344
0
0
884
96 1237
470 0 2 75 23
0 0
0 3253440
7988 4996492
0
0
186
0 1061
112 0 0 95 4
0 0
0 3253440
7988 4996492
0
0
0
0 1012
14 0 0 100
0

67

© 2013 Pythian - Presentation for OakWorld
Commited_AS / CommitLimit
• Committed_AS
• Total

memory requested on the system
• Not used, just requested
• If every process in the system is to touch and
use the memory it has requested, this is how
much would be used
• CommitLimit
• Total memory that can be requested
• Should factor over allocate
• Memory allocation errors* when you reach
limit – (overcommit_memory)
70

© 2013 Pythian - Presentation for OakWorld
Commit_AS example
cat grab.c
main() {void *p;
p=malloc(1073741824);
sleep(60);}
cat /proc/meminfo
...
MemFree:
3 230 592 kB
...
Committed_AS:
49 972 kB
./grab
cat /proc/meminfo
...
MemFree:
3 230 464 kB
...
Committed_AS: 1 098 808 kB

71

© 2013 Pythian - Presentation for OakWorld
Slab
• Slab

– ―in-kernel data structures cache‖
• similar to Oracle‘s ―shared_pool‖
• designed to prevent memory fragmentation
• detailed monitoring:
/proc/slabinfo
slabtop
• Basically ―system space‖

72

© 2013 Pythian - Presentation for OakWorld
slabtop example
Active / Total Objects (% used)
Active / Total Slabs (% used)
Active / Total Caches (% used)
Active / Total Size (% used)
Minimum / Average / Maximum Object
OBJS ACTIVE USE OBJ SIZE
32382 24900 76%
0.27K
56925 40013 70%
0.05K
364
363 99%
4.00K
2485
2471 99%
0.54K
2376
413 17%
0.50K
256
256 100%
3.00K
4576
4481 97%
0.15K
10248
4548 44%
0.06K
4340
1215 27%
0.12K
1980
316 15%
0.25K
…

73

:
:
:
:
:

88874 / 139343 (63.8%)
5839 / 5846 (99.9%)
90 / 132 (68.2%)
17286.03K / 23311.27K (74.2%)
0.01K / 0.17K / 128.00K

SLABS OBJ/SLAB CACHE SIZE NAME
2313
14
9 252K radix_tree_node
759
75
3 036K buffer_head
364
1
1 456K size-4096
355
7
1 420K ext3_inode_cache
297
8
1 188K size-512
128
2
1 024K biovec-(256)
176
26
704K dentry_cache
168
61
672K size-64
140
31
560K size-128
132
15
528K size-256

© 2013 Pythian - Presentation for OakWorld
HugePages
• HugePages_Total
• HugePages_Free
• HugePages_Rsvd

• Allocated

but untouched pages
• Must have Rsvd amount FREE hugepages or
bad things happen to Oracle
• Hugepages are:
• Locked in memory
• 512 larger than regular 4KiB pages
• Requires 512 times less PTE Entries
74

© 2013 Pythian - Presentation for OakWorld
HugePages - Example
• Config:
•

1.7 Gb sga (max on 32 bit without VLM)

•

1400 Mb in db_cache_size

•

table sized to fit exactly in cache

• Test
• Start

100 sessions,
• full scan test table (cached) in order to
touch the memory and allocate the PTEs
• Sessions will wait via dbms_lock.allocate to
be released
• Show before and after PageTables usage
75

© 2013 Pythian - Presentation for OakWorld
HugePages - Example
Before starting the sessions (db is UP)
cat /proc/meminfo
…

MemFree:

1 070 472 kB

PageTables:

4 932 kB

After sessions have finished touching the memory
cat /proc/meminfo
…
MemFree:

473 496 kB

PageTables:

295 068 kB

76

© 2013 Pythian - Presentation for OakWorld
PTE Tables
• Page

Table Entries

•
•
•

Per process non-shareable (except ISM solaris)
Minimum 16 bytes in size*

100 processes (read sessions) mapping 200 GiB of SGA
200*1024*1024/4 = 52‘428‘800 (4KiB pages) * 16 bytes
800 MiB PER PROCESS
Total: 80’000 MiB

•

77

With HugePages
• 1600 KiB per process
Total: 156 Mib

A New Page Table for 64-bit Address Spaces
Madhusudhan Talluri, Sun,
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.
1.1.110.4178&rep=rep1&type=pdf

© 2013 Pythian - Presentation for OakWorld
CGROUPS

78
CGROUPS

• Linux

resource manager Supports:

blkio — this subsystem sets limits on input/output access to and from block devices such as
physical drives (disk, solid state, USB, etc.).

cpu — this subsystem uses the scheduler to provide cgroup tasks access to the CPU.
cpuacct — this subsystem generates automatic reports on CPU resources used by tasks in a
cgroup.

cpuset — this subsystem assigns individual CPUs (on a multicore system) and memory nodes to
tasks in a cgroup.

devices — this subsystem allows or denies access to devices by tasks in a cgroup.
freezer — this subsystem suspends or resumes tasks in a cgroup.
memory — this subsystem sets limits on memory use by tasks in a cgroup, and generates
automatic reports on memory resources used by those tasks.

net_cls

— this subsystem tags network packets with a class identifier (classid) that allows the
Linux traffic controller (tc) to identify packets originating from a particular cgroup task.

net_prio

— this subsystem provides a way to dynamically set the priority of network traffic
per network interface.

ns — the namespace subsystem
79

© 2013 Pythian - Presentation for OakWorld
CGROUPS – memory
• Hierarchical

memory control

• Inherited
• Includes

shared pages
• Includes file system cache
• Includes SWAP
• Can include KERNEL (slab, sockets, stack)

80

© 2013 Pythian - Presentation for OakWorld
CGROUPS – memory
• memory.usage_in_bytes
• memory.memsw.usage_in_bytes
• memory.oom_control

• memory.soft_limit_in_bytes
• Notifier
• low/medium/critical

81

© 2013 Pythian - Presentation for OakWorld
CGROUPS – testing
• Mount

memory cgroup module (doc)
• Create cgroup ―0‖
• echo ―$$‖ of bash to 0/task
• startup database
• Run:
wile [[ 1 ]] ; do echo $((`cat
memory.memsw.usage_in_bytes`/1000000
)) ; sleep 1 ; done

82

© 2013 Pythian - Presentation for OakWorld
CGROUPS – example 1
867
SQL> create tablespace mytest
datafile size 1g;
Tablespace created.
SQL>
1871

83

© 2013 Pythian - Presentation for OakWorld
CGROUPS – shutdown
1872
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
1077

84

© 2013 Pythian - Presentation for OakWorld
CGROUPS – file delete
1862
SQL> drop tablespace mytest;

Tablespace dropped.
789

85

© 2013 Pythian - Presentation for OakWorld
CGROUPS – direct IO
798
SQL> create tablespace mytest
datafile size 1g;
Tablespace created.
798

86

© 2013 Pythian - Presentation for OakWorld
CGROUPS – direct path
799
SQL> insert /*+APPEND*/ into t1
select * from t1;
331040 rows created.
SQL> commit;
Commit complete.
799
87

© 2013 Pythian - Presentation for OakWorld
CGROUPS – 4g
alter system set memory_target=4g
scope=spfile;
System altered.
startup
2597

88

© 2013 Pythian - Presentation for OakWorld
CGROUPS – sga init
4939 622
SQL> select count(*) from t1;
--"_serial_direct_read" = never;
5158
5158
…
5158
5158
5159
89

664
680
844
904
973
© 2013 Pythian - Presentation for OakWorld
Monitoring Memory from
Oracle

90
Oracle views
• V$PROCESS
• PGA_USED_MEM,PGA_ALLOC_MEM,

PGA_FREA

BLE_MEM, PGA_MAX_MEM
• V$PROCESS_MEMORY
• PL/SQL vs SQL vs Other
• V$PROCESS_MEMORY_DETAIL
• Not populated
• Requires event ―PGA_DETAIL_GET― to be set
• Only for testing

91

© 2013 Pythian - Presentation for OakWorld
Thank you and Q&A
To contact us…
sales@pythian.com

1-877-PYTHIAN

To follow us…
http://www.pythian.com/news/
http://www.facebook.com/pages/The-Pythian-Group/163902527671
@pythian
@pythianjobs
http://www.linkedin.com/company/pythian

© 2009/2010 Pythian - Presentation for ABC Company

More Related Content

What's hot

Understanding oracle rac internals part 2 - slides
Understanding oracle rac internals   part 2 - slidesUnderstanding oracle rac internals   part 2 - slides
Understanding oracle rac internals part 2 - slidesMohamed Farouk
 
Oracle Database performance tuning using oratop
Oracle Database performance tuning using oratopOracle Database performance tuning using oratop
Oracle Database performance tuning using oratopSandesh Rao
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsJohn Kanagaraj
 
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1SolarWinds
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Kyle Hailey
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfSrirakshaSrinivasan2
 
TFA Collector - what can one do with it
TFA Collector - what can one do with it TFA Collector - what can one do with it
TFA Collector - what can one do with it Sandesh Rao
 
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...InfluxData
 
The Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationThe Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationMarkus Michalewicz
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder
 
Deep review of LMS process
Deep review of LMS processDeep review of LMS process
Deep review of LMS processRiyaj Shamsudeen
 
Same plan different performance
Same plan different performanceSame plan different performance
Same plan different performanceMauro Pagano
 
Oracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 VersionOracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 VersionMarkus Michalewicz
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsEnkitec
 
Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Anil Nair
 
Oracle AWR Data mining
Oracle AWR Data miningOracle AWR Data mining
Oracle AWR Data miningYury Velikanov
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWRpasalapudi
 

What's hot (20)

Understanding oracle rac internals part 2 - slides
Understanding oracle rac internals   part 2 - slidesUnderstanding oracle rac internals   part 2 - slides
Understanding oracle rac internals part 2 - slides
 
Oracle Database performance tuning using oratop
Oracle Database performance tuning using oratopOracle Database performance tuning using oratop
Oracle Database performance tuning using oratop
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
 
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
 
AWR and ASH Deep Dive
AWR and ASH Deep DiveAWR and ASH Deep Dive
AWR and ASH Deep Dive
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
 
TFA Collector - what can one do with it
TFA Collector - what can one do with it TFA Collector - what can one do with it
TFA Collector - what can one do with it
 
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
 
The Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationThe Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - Presentation
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools short
 
Deep review of LMS process
Deep review of LMS processDeep review of LMS process
Deep review of LMS process
 
Same plan different performance
Same plan different performanceSame plan different performance
Same plan different performance
 
Oracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 VersionOracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 Version
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19
 
Ash and awr deep dive hotsos
Ash and awr deep dive hotsosAsh and awr deep dive hotsos
Ash and awr deep dive hotsos
 
Oracle AWR Data mining
Oracle AWR Data miningOracle AWR Data mining
Oracle AWR Data mining
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWR
 

Viewers also liked

Indexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management InternalsIndexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management InternalsChristian Antognini
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writerKyle Hailey
 
How to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemHow to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemCary Millsap
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersKyle Hailey
 
AWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add upAWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add upJohn Beresniewicz
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamalKamal Maiti
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseKyle Hailey
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumptionhaish
 
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex GorbachevBenchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex GorbachevAlex Gorbachev
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory ManagementNi Zo-Ma
 
Average Active Sessions RMOUG2007
Average Active Sessions RMOUG2007Average Active Sessions RMOUG2007
Average Active Sessions RMOUG2007John Beresniewicz
 
SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013 SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013 Kyle Hailey
 
Average Active Sessions - OaktableWorld 2013
Average Active Sessions - OaktableWorld 2013Average Active Sessions - OaktableWorld 2013
Average Active Sessions - OaktableWorld 2013John Beresniewicz
 
Linux memorymanagement
Linux memorymanagementLinux memorymanagement
Linux memorymanagementpradeepelinux
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensicsINSIGHT FORENSIC
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory modelSeongJae Park
 

Viewers also liked (20)

Indexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management InternalsIndexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management Internals
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
 
Intro to ASH
Intro to ASHIntro to ASH
Intro to ASH
 
How to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemHow to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problem
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmasters
 
AWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add upAWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add up
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumption
 
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex GorbachevBenchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Hugepage
HugepageHugepage
Hugepage
 
Average Active Sessions RMOUG2007
Average Active Sessions RMOUG2007Average Active Sessions RMOUG2007
Average Active Sessions RMOUG2007
 
SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013 SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013
 
Average Active Sessions - OaktableWorld 2013
Average Active Sessions - OaktableWorld 2013Average Active Sessions - OaktableWorld 2013
Average Active Sessions - OaktableWorld 2013
 
Linux memorymanagement
Linux memorymanagementLinux memorymanagement
Linux memorymanagement
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensics
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory model
 

Similar to Oracle, Memory & Linux: Understanding Virtual Memory

Christo kutrovsky oracle rac solving common scalability problems
Christo kutrovsky   oracle rac solving common scalability problemsChristo kutrovsky   oracle rac solving common scalability problems
Christo kutrovsky oracle rac solving common scalability problemsChristo Kutrovsky
 
Christo Kutrovsky - Maximize Data Warehouse Performance with Parallel Queries
Christo Kutrovsky - Maximize Data Warehouse Performance with Parallel QueriesChristo Kutrovsky - Maximize Data Warehouse Performance with Parallel Queries
Christo Kutrovsky - Maximize Data Warehouse Performance with Parallel QueriesChristo Kutrovsky
 
OOW13: It's a solid state-world
OOW13: It's a solid state-worldOOW13: It's a solid state-world
OOW13: It's a solid state-worldMarc Fielding
 
A5 oracle exadata-the game changer for online transaction processing data w...
A5   oracle exadata-the game changer for online transaction processing data w...A5   oracle exadata-the game changer for online transaction processing data w...
A5 oracle exadata-the game changer for online transaction processing data w...Dr. Wilfred Lin (Ph.D.)
 
HPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big DataHPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big DataHPC DAY
 
OOW 2013 Highlights
OOW 2013 HighlightsOOW 2013 Highlights
OOW 2013 HighlightsAna Galindo
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture PerformanceEnkitec
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Bobby Curtis
 
Exadata x3 workshop
Exadata x3 workshopExadata x3 workshop
Exadata x3 workshopFran Navarro
 
Exadata 12c New Features RMOUG
Exadata 12c New Features RMOUGExadata 12c New Features RMOUG
Exadata 12c New Features RMOUGFuad Arshad
 
KSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success StoryKSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success StoryKristofferson A
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceEnkitec
 
Nimble Storage Series A presentation 2007
Nimble Storage Series A presentation 2007Nimble Storage Series A presentation 2007
Nimble Storage Series A presentation 2007Wing Venture Capital
 
Under The Hood Of A Shard-Per-Core Database Architecture
Under The Hood Of A Shard-Per-Core Database ArchitectureUnder The Hood Of A Shard-Per-Core Database Architecture
Under The Hood Of A Shard-Per-Core Database ArchitectureScyllaDB
 
Performance challenges in software networking
Performance challenges in software networkingPerformance challenges in software networking
Performance challenges in software networkingStephen Hemminger
 
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...OVHcloud
 
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast DataDatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast DataHakka Labs
 

Similar to Oracle, Memory & Linux: Understanding Virtual Memory (20)

Christo kutrovsky oracle rac solving common scalability problems
Christo kutrovsky   oracle rac solving common scalability problemsChristo kutrovsky   oracle rac solving common scalability problems
Christo kutrovsky oracle rac solving common scalability problems
 
Session 307 ravi pendekanti engineered systems
Session 307  ravi pendekanti engineered systemsSession 307  ravi pendekanti engineered systems
Session 307 ravi pendekanti engineered systems
 
Christo Kutrovsky - Maximize Data Warehouse Performance with Parallel Queries
Christo Kutrovsky - Maximize Data Warehouse Performance with Parallel QueriesChristo Kutrovsky - Maximize Data Warehouse Performance with Parallel Queries
Christo Kutrovsky - Maximize Data Warehouse Performance with Parallel Queries
 
OOW13: It's a solid state-world
OOW13: It's a solid state-worldOOW13: It's a solid state-world
OOW13: It's a solid state-world
 
A5 oracle exadata-the game changer for online transaction processing data w...
A5   oracle exadata-the game changer for online transaction processing data w...A5   oracle exadata-the game changer for online transaction processing data w...
A5 oracle exadata-the game changer for online transaction processing data w...
 
HPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big DataHPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big Data
 
OOW 2013 Highlights
OOW 2013 HighlightsOOW 2013 Highlights
OOW 2013 Highlights
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
 
Exadata x3 workshop
Exadata x3 workshopExadata x3 workshop
Exadata x3 workshop
 
Exadata 12c New Features RMOUG
Exadata 12c New Features RMOUGExadata 12c New Features RMOUG
Exadata 12c New Features RMOUG
 
KSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success StoryKSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success Story
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
Why_Oracle_Hardware.ppt
Why_Oracle_Hardware.pptWhy_Oracle_Hardware.ppt
Why_Oracle_Hardware.ppt
 
Chicago spark meetup-april2017-public
Chicago spark meetup-april2017-publicChicago spark meetup-april2017-public
Chicago spark meetup-april2017-public
 
Nimble Storage Series A presentation 2007
Nimble Storage Series A presentation 2007Nimble Storage Series A presentation 2007
Nimble Storage Series A presentation 2007
 
Under The Hood Of A Shard-Per-Core Database Architecture
Under The Hood Of A Shard-Per-Core Database ArchitectureUnder The Hood Of A Shard-Per-Core Database Architecture
Under The Hood Of A Shard-Per-Core Database Architecture
 
Performance challenges in software networking
Performance challenges in software networkingPerformance challenges in software networking
Performance challenges in software networking
 
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
 
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast DataDatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
 

More from Kyle Hailey

Hooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeHooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeKyle Hailey
 
Performance insights twitch
Performance insights twitchPerformance insights twitch
Performance insights twitchKyle Hailey
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoringKyle Hailey
 
Successfully convince people with data visualization
Successfully convince people with data visualizationSuccessfully convince people with data visualization
Successfully convince people with data visualizationKyle Hailey
 
Virtual Data : Eliminating the data constraint in Application Development
Virtual Data :  Eliminating the data constraint in Application DevelopmentVirtual Data :  Eliminating the data constraint in Application Development
Virtual Data : Eliminating the data constraint in Application DevelopmentKyle Hailey
 
DBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentDBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentKyle Hailey
 
Accelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataAccelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataKyle Hailey
 
Delphix and Pure Storage partner
Delphix and Pure Storage partnerDelphix and Pure Storage partner
Delphix and Pure Storage partnerKyle Hailey
 
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
Mark Farnam  : Minimizing the Concurrency Footprint of TransactionsMark Farnam  : Minimizing the Concurrency Footprint of Transactions
Mark Farnam : Minimizing the Concurrency Footprint of TransactionsKyle Hailey
 
Dan Norris: Exadata security
Dan Norris: Exadata securityDan Norris: Exadata security
Dan Norris: Exadata securityKyle Hailey
 
Martin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysMartin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysKyle Hailey
 
Data as a Service
Data as a Service Data as a Service
Data as a Service Kyle Hailey
 
Data Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloningData Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloning Kyle Hailey
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'Kyle Hailey
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationKyle Hailey
 
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Kyle Hailey
 
Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Kyle Hailey
 
Oaktable World 2014 Kevin Closson: SLOB – For More Than I/O!
Oaktable World 2014 Kevin Closson:  SLOB – For More Than I/O!Oaktable World 2014 Kevin Closson:  SLOB – For More Than I/O!
Oaktable World 2014 Kevin Closson: SLOB – For More Than I/O!Kyle Hailey
 
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14Kyle Hailey
 

More from Kyle Hailey (20)

Hooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeHooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume Lelarge
 
Performance insights twitch
Performance insights twitchPerformance insights twitch
Performance insights twitch
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoring
 
Successfully convince people with data visualization
Successfully convince people with data visualizationSuccessfully convince people with data visualization
Successfully convince people with data visualization
 
Virtual Data : Eliminating the data constraint in Application Development
Virtual Data :  Eliminating the data constraint in Application DevelopmentVirtual Data :  Eliminating the data constraint in Application Development
Virtual Data : Eliminating the data constraint in Application Development
 
DBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentDBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application Development
 
Accelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataAccelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual Data
 
Delphix and Pure Storage partner
Delphix and Pure Storage partnerDelphix and Pure Storage partner
Delphix and Pure Storage partner
 
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
Mark Farnam  : Minimizing the Concurrency Footprint of TransactionsMark Farnam  : Minimizing the Concurrency Footprint of Transactions
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
 
Dan Norris: Exadata security
Dan Norris: Exadata securityDan Norris: Exadata security
Dan Norris: Exadata security
 
Martin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysMartin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle Guys
 
What is DevOps
What is DevOpsWhat is DevOps
What is DevOps
 
Data as a Service
Data as a Service Data as a Service
Data as a Service
 
Data Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloningData Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloning
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualization
 
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
 
Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix
 
Oaktable World 2014 Kevin Closson: SLOB – For More Than I/O!
Oaktable World 2014 Kevin Closson:  SLOB – For More Than I/O!Oaktable World 2014 Kevin Closson:  SLOB – For More Than I/O!
Oaktable World 2014 Kevin Closson: SLOB – For More Than I/O!
 
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
 

Recently uploaded

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Oracle, Memory & Linux: Understanding Virtual Memory

  • 1. Oracle, Memory & Linux Presented by: Christo Kutrovsky
  • 2. Who Am I • Oracle ACE • 12 years in Oracle field • Joined Pythian 2003 • Part of Pythian Consulting Group • 2 Performance tuning • • Special projects • “oracle pinup” Critical services Presenter at: IOUG, RMOUG, UKOUG, OpenWorld © 2013 Pythian - Presentation for OakWorld
  • 3. Pythian Pythian provides services to companies and organizations that are dependent on data © 2013 Pythian - Presentation for OakWorld ©The Pythian Group
  • 4. Pythian Facts • • • • • • • • • • • Founded in 1997, over 15 years as a profitable, private company 200 employees and growing 200 customers worldwide, 34 customers more than $1 billion in revenue 5 offices in 5 countries Employ 8 Oracle ACEs (Including 2 ACE Directors) and 2 Microsoft MVPs Platinum level partner in the Oracle Partner Network Gold level partner in the Microsoft Partner Network Winner of 2011 Oracle Partner Network Titan Award Ranked among Canada‘s Fastest Growing Companies in the Profit 200 in 2010, 2011 & 2012 Ranked in the Top 250 Canadian ITC Companies in Branham300 Average response time to alerts under 5 minutes © 2013 Pythian - Presentation for OakWorld
  • 5. Why Pythian Recognized Leader: • Global industry leader in data infrastructure managed services and consulting with expertise in Oracle, Oracle Applications, Microsoft SQL Server, MySQL, big data and systems administration • Work with over 200 multinational companies such as Forbes.com, Fox Sports, Nordion and Western Union to help manage their complex IT deployments Expertise: • One of the world‘s largest concentrations of dedicated, full-time DBA expertise. Employ 8 Oracle ACEs/ACE Directors • Hold 7 Specializations under Oracle Platinum Partner program, including Oracle Exadata, Oracle GoldenGate & Oracle RAC Global Reach & Scalability: • 24/7/365 global remote support for DBA and consulting, systems administration, special projects or emergency response © 2013 Pythian - Presentation for OakWorld
  • 6. Agenda • Types of Physical Memory • Virtual Memory • Types of memory • How to monitor memory usage • Oracle specifics • HugePages effect • Oracle Views 6 © 2013 Pythian - Presentation for OakWorld
  • 8. It’s all memory • CPU registers • CPU Cache L1 • CPU Cache L2 • CPU Cache L3 • Main Memory (RAM) • Remote memory in NUMA • • Magnetic Storage (―DISK‖) • 9 SSD Cache (*new*) Tape © 2013 Pythian - Presentation for OakWorld
  • 9. The Difference • CPU registers • CPU Cache L1 • CPU Cache L2 • CPU Cache L3 • Main Memory (RAM) • PERFORMANCE Remote memory in NUMA • • Magnetic Storage (―DISK‖) • 10 SSD Cache (*new*) Tape © 2013 Pythian - Presentation for OakWorld
  • 10. What is PERFORMANCE • Performance is defined by: • Latency – the amount of time from data request to data receive • Bandwidth – how much data can flow in best case scenario • Cost – pure $$$ 11 © 2013 Pythian - Presentation for OakWorld
  • 12. Different memory – Intel i7 • CPU registers –128 bytes / 0.3* ns (1 cycle) • CPU Cache L1 – 64 KiB / 1.2* ns • CPU Cache L2 – 256 KiB / 3.0* ns • CPU Cache L3 – 12 MiB / 12* ns • Local core (1.0x), remote core (1.6x), dirty (1.9x), remote (4x) • Main • Memory (RAM) – 1 TiB or more / 60 ns Remote RAM (multi-socket) – 100 ns • SSD Cache (*new*) – Any / 60,000 ns • Magnetic Storage (―DISK‖) – Any / 3,000,000 ns http://www.tomshardware.com/reviews/Intel-i7-nehalem-cpu,2041-10.html http://software.intel.com/sites/products/collateral/hpc/vtune/performance_analysis_guide.pdf 13 http://en.wikipedia.org/wiki/Memory_hierarchy *CPU Cache time measured for 3.3 Ghz CPU © 2013 Pythian - Presentation for OakWorld
  • 13. Scaled to real life • CPU Registers – 0.3 seconds your hands • CPU Cache – 3 seconds your desk • L3 cache is your desk drawer – 12 sec (48 sec if locked) • RAM – 60 seconds - the storage room in the basement • SSD – 16.6 Hours • Disk – 34 days • 14 Used to be 8 hours © 2013 Pythian - Presentation for OakWorld
  • 14. Memory Hierarchy – To Scale CPU Registers 1x L1 L2 L1/L2/L3 CACHE 4x -> 2.5x -> 4x (16x) 512-> 4x -> 48x (192x) L3 RAM (256 GiB) Latency = 5x Size = 22,000x 15 © 2013 Pythian - Presentation for OakWorld
  • 15. Memory Hierarchy – To Scale 2 L3 CACHE 4x (16x) 48x (192x) RAM Latency = 5x Size = 22,000x SSD (4 TiB) Latency =1,000x Size = 16x DISK (100 TiB) Latency = 50x Size = 25x 16 © 2013 Pythian - Presentation for OakWorld
  • 16. RAM • Not • so significant latency implication 4x -> 2.5x -> 4x -> 5x -> 1000x -> 50x • Significant • 512x -> 4x -> 48x -> 22,000x ->16x ->25x • Your • 17 size up compared to previous layers most important cache It‘s a cache because it‘s still volatile © 2013 Pythian - Presentation for OakWorld
  • 18. How a computer works • Read • instructions from memory In the old days it was from a cassette or even paper punch cards • Execute instructions, which read some more memory • Produce results • stores them in memory • display them Paper or Screen • 19 (or sound) © 2013 Pythian - Presentation for OakWorld
  • 19. How we use a computer • Do many things • • Expect them to run unaware of each other • 20 Run multiple applications at the same time One application must in no way interfere with another © 2013 Pythian - Presentation for OakWorld
  • 20. Virtual Memory attempts to abstract the ‗read/write‘ concept and just work with ―memory‖ 21 © 2013 Pythian - Presentation for OakWorld
  • 21. The Goal of Virtual Memory • Write programs that do not directly depend on the amount of RAM • More RAM available – program runs faster • Simplify memory management • Run independently, safely • OS controls what stays in RAM and what and when is evicted • Optimal file cache usage 22 © 2013 Pythian - Presentation for OakWorld
  • 22. VM Offers • Protection • Independent memory space • Features • read/write/execute permissions • maximize memory reuse/sharing • mmap – memory mapped files – work with files as if they were ―loaded‖ in memory • allocate more memory than available 23 © 2013 Pythian - Presentation for OakWorld
  • 23. VM Visualized oraclegcdw1 0 Gb 155Mb 27 Gb 26’000 Mb 12 /…/11.2.0/dbhome_1/bin/oracle PID USER 23235 oracle /lib64/librt-2.5.so 4 Mb Oracle’s SGA Data 4 P T E PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 16 0 25.7g 546m 202m S 63.9 0.8 308:51.92 oraclegcdw1 (LOCAL=N cat /proc/pid/status … VmPeak: 26898012 kB VmSize: 26898012 kB VmLck: 0 kB VmHWM: 559248 kB 24 VmRSS: 559248 kB VmData: VmStk: VmExe: VmLib: VmPTE: 5032 96 155348 12260 4328 kB kB kB kB kB © 2013 Pythian - Presentation for OakWorld
  • 24. VM Visualized oraclegcdw1 27 Gb 0 Gb 155Mb 26’000 Mb 12 /…/11.2.0/dbhome_1/bin/oracle /lib64/librt-2.5.so Loaded from disk i.e. copied from slower memory © 2013 Pythian - Presentation for OakWorld 4 Mb Oracle’s SGA Data “Anonymous” i.e. not copied 4 P T E
  • 25. VM Memory types • Two types of memory • With a disk representation • Without a disk representation • 26 Depends on on OS it‘s called ―Anonymous‖, ―computed‖ and other names. © 2013 Pythian - Presentation for OakWorld
  • 26. VM Visualized 23235 oraclegcdw1 27 Gb 0 Gb 155Mb 26’000 Mb 12 /…/11.2.0/dbhome_1/bin/oracle /lib64/librt-2.5.so 4 Mb Oracle’s SGA Data Data 155Mb 0 Gb 12 26’000 Mb 23184 oraclegcdw1 © 2013 Pythian - Presentation for OakWorld 4 Mb 27 Gb 4 P T E 4 P T E
  • 27. VM Memory types • Shared • everything from disk • IPC shared memory segments • Private • Anonymous memory • ―copy on write‖ 28 © 2013 Pythian - Presentation for OakWorld
  • 28. /proc/meminfo cat /proc/meminfo Buffers: 613 Cached: 38 120 SwapCached: 10 Active: 35 034 Inactive: 12 114 HighTotal: HighFree: LowTotal: 74 027 LowFree: 22 744 SwapTotal: 16 771 SwapFree: 16 761 Dirty: 9 Writeback: AnonPages: 8 402 Mapped: 18 820 Slab: 1 165 PageTables: 2 620 29 944 544 748 160 512 0 0 752 448 852 104 656 0 424 948 376 300 kB kB Copied from Disk kB kB kB kB kB kB kB kB kB kB kB kB NOT from Disk kB kB kB VM Metadata © 2013 Pythian - Presentation for OakWorld
  • 29. VM Table Shared Anonymous SGA Data From Disk 30 Private Binaries, libs © 2013 Pythian - Presentation for OakWorld
  • 30. VM Table Shared Private Anonymous SGA* Data From Disk Binaries, libs *HugePages is different 31 Cached © 2013 Pythian - Presentation for OakWorld AnonPages
  • 31. /proc/meminfo cat /proc/meminfo Buffers: 613 Cached: 38 120 SwapCached: 10 Active: 35 034 Inactive: 12 114 HighTotal: HighFree: LowTotal: 74 027 LowFree: 22 744 SwapTotal: 16 771 SwapFree: 16 761 Dirty: 9 Writeback: AnonPages: 8 402 Mapped: 18 820 Slab: 1 165 PageTables: 2 620 32 944 544 748 160 512 0 0 752 448 852 104 656 0 424 948 376 300 kB kB File System Cache, Binaries kB kB kB kB kB kB kB kB kB kB kB kB Private Data, Stack, etc. kB kB kB VM Metadata © 2013 Pythian - Presentation for OakWorld Oracle SGA Oracle PGA
  • 32. /proc/meminfo - hugepages cat /proc/meminfo Buffers: 493 Cached: 10 093 SwapCached: Active: 11 311 Inactive: 1 821 HighTotal: HighFree: LowTotal: 82 450 LowFree: 3 202 SwapTotal: 2 097 SwapFree: 2 093 Dirty: Writeback: AnonPages: 2 636 Mapped: 138 Slab: 482 PageTables: 47 33 232 112 0 344 104 0 0 640 516 144 676 580 0 020 272 468 132 kB kB File System Cache, Binaries kB Oracle SGA kB HugePages_Total: 32000 8980 kB HugePages_Free: 1197 kB HugePages_Rsvd: kB kB kB kB kB kB kB kB Private Data, Stack, etc. Oracle PGA kB kB kB VM Metadata © 2013 Pythian - Presentation for OakWorld
  • 33. /proc/meminfo – example 2 cat /proc/meminfo Buffers: 654 Cached: 37 806 SwapCached: 101 Active: 34 262 Inactive: 9 524 HighTotal: HighFree: LowTotal: 74 027 LowFree: 20 683 SwapTotal: 16 771 SwapFree: 16 670 Dirty: 14 Writeback: AnonPages: 5 222 Mapped: 24 687 Slab: 1 371 PageTables: 7 843 34 908 532 112 824 280 0 0 752 044 852 740 328 0 736 736 528 932 kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB File System Cache, Binaries HugePages_Total: HugePages_Free: HugePages_Rsvd: Oracle SGA 0 0 0 Private Data, Stack, etc. VM Metadata © 2013 Pythian - Presentation for OakWorld
  • 34. Oracle’s SGA • Without HugePages • In CACHED section • With HugePages • Not in CACHED section 35 © 2013 Pythian - Presentation for OakWorld
  • 35. Oracle’s memory Oracle memory type OS Location OS Location (HugePages) *pool SGA Cached - *cache_size SGA Cached - Sort/Hash PGA AnonPages AnonPages PL/SQL variables, arrays, workspace UGA AnonPages AnonPages Local cursor cache, UGA workareas etc. AnonPages AnonPages Bind variable data UGA (+SGA) AnonPages AnonPages Binaries 36 Oracle location - Cached Cached © 2013 Pythian - Presentation for OakWorld
  • 36. What is HugePages •A separate memory area that is • Used only for shared memory segments* • Non-swappable – locked in memory • Thus not managed by VM memory • Managed segments 37 in 2 Mb continuous memory © 2013 Pythian - Presentation for OakWorld
  • 37. What is HugePages With HugePages pool Default 24 GB RAM 72 GB RAM 48 GB HugePages 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 38 2 MB © 2013 Pythian - Presentation for OakWorld 2 MB 4K 2 MB 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K 2 MB 2 MB
  • 38. VM Tricks – untouched memory • Untouched memory does not exists • No PTE entires • No memory consumed 39 © 2013 Pythian - Presentation for OakWorld
  • 39. VM Tricks – untouched memory cat grab.c main() {void *p; p=malloc(1073741824); sleep(60);} cat /proc/meminfo ... MemFree: 3 230 592 kB ... Committed_AS: 49 972 kB ./grab cat /proc/meminfo ... MemFree: 3 230 464 kB ... Committed_AS: 1 098 808 kB 40 © 2013 Pythian - Presentation for OakWorld
  • 40. VM Tricks – untouched memory • What does that mean for Oracle? • Non-initialized SGA (db_cache) takes no memory • Untouched SGA by a new process consumes no PTE entries cat /proc/pid/status … VmPeak: 26 898 012 kB VmSize: 26 898 012 kB VmLck: 0 kB VmHWM: 559 248 kB VmRSS: 559 248 kB 41 VmData: VmStk: VmExe: VmLib: VmPTE: 5032 96 155348 12260 4328 © 2013 Pythian - Presentation for OakWorld kB kB kB kB kB
  • 41. VM Tricks - swap • Memory can be both swapped and not-swapped • Only anonymous memory is swapped • Hugepages cannot be swapped, ever • Linux swaps recently unused memory in anticipation of it‘s eviction • Only ―touched‖ memory needs to be swapped • SwapCached shows memory that exists in both swap and RAM • Actual swapping: SwapTotal – SwapFree - SwapCached 42 © 2013 Pythian - Presentation for OakWorld
  • 42. VM Tricks - OverCommit • Linux can allocate more memory that is available • Available = RAM + Total SWAP • True ―out of memory‖ on linux very rare • Controlled via /proc/sys/vm/overcommit_memory /proc/sys/vm/overcommit_ratio • OOM Killer – Out Of Memory Killer • A kernel thread that kills abusers 43 © 2013 Pythian - Presentation for OakWorld
  • 43. VM Tricks – Solaris • Solaris is different • VM Concept similar • Difference in implementation • No Overcommit • No OOM Killer • All anonymous pages MUST* have the available swap, should they need to be swapped • Oracle‘s SGA is anonymous * Unless using ISM 44 © 2013 Pythian - Presentation for OakWorld
  • 44. VM Tricks – Solaris Pages • Hugepages are automatic • • If available… • 45 Multiple sizes: 64K, 2Mb, 64 Mb Shutdown database, copy files, startup – uses more smaller pages © 2013 Pythian - Presentation for OakWorld
  • 45. VM Tricks – Solaris ISM/DISM • PTE Tables are shareable • ISM – Intimate Shared Memory • Memory locked • DISM – Dynamic Intimate Shared Memory • Memory lockable • Requires SGA size in available SWAP space • If sga_max_size > sga_target • DISM is used • Needs ORADISM to run as root, to lock SGA • And project limits relaxed 46 © 2013 Pythian - Presentation for OakWorld
  • 47. Linux memory tools • Global • /proc/meminfo • vmstat • Ipcs • cgroups (**) • Per process • top • /proc/pid/status • /proc/pid/maps 48 © 2013 Pythian - Presentation for OakWorld
  • 48. Solaris memory tools • Global • prstat • vmstat • ipcs • ―memstat‖ • kernel debugger call echo ―::memstat‖|mdb -k • Per process • pmap -x 49 © 2013 Pythian - Presentation for OakWorld
  • 49. prstat PID USERNAME SIZE RSS STATE PRI 23042 oracle 8134M 8079M cpu0 1027 oracle 122M 77M sleep 1254 oracle 8136M 8078M sleep 1069 oracle 74M 51M sleep 1007 oracle 119M 84M sleep 23032 root 4112K 3824K cpu46 23041 oracle 44M 14M sleep 23017 root 7544K 6240K sleep 1276 oracle 8134M 8077M sleep 1092 oracle 56M 42M sleep 50 NICE 0 59 59 49 59 59 59 59 59 59 0 0 0 0 0 0 0 0 0 0 TIME CPU PROCESS/NLWP 0:00:03 0.2% oracle/2 14:33:26 0.0% oraagent.bin/34 6:41:32 0.0% oracle/1 4:37:37 0.0% ocssd.bin/15 3:08:58 0.0% ohasd.bin/39 0:00:00 0.0% prstat/1 0:00:00 0.0% sqlplus/1 0:00:00 0.0% sshd/1 1:10:51 0.0% oracle/1 1:28:33 0.0% diskmon.bin/6 © 2013 Pythian - Presentation for OakWorld
  • 50. Vmstat Solaris • No way to tell if the system is swaping or writing to disk • Vmstat –s ―so‖ and ―si‖ – always zero • Best guess is a combination of non-zero ―sr‖ and ―po‖/‖pi‖ and activity on swap device 51 © 2013 Pythian - Presentation for OakWorld
  • 51. Vmstat – Solaris vmstat 2 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr s0 s1 s2 s3 in sy cs us sy 3 0 0 15940984 1785088 8 23 0 5 5 0 0 10 28 7 5 8296 28180 10890 6 2 0 0 0 15411984 1412504 4 11 0 0 0 0 0 0 0 2 0 4487 1919 2483 0 0 0 0 0 15411664 1412248 0 1 0 0 0 0 0 0 0 1 0 4476 1530 2438 0 0 ^C id 92 100 100 vmstat -S 2 kthr memory page disk faults cpu r b w swap free si so pi po fr de sr s0 s1 s2 s3 in sy cs us sy 3 0 0 15940968 1785080 0 0 0 5 5 0 0 10 28 7 5 8296 28179 10890 6 2 0 0 0 15411960 1412480 0 0 0 0 0 0 0 0 0 2 0 4446 1560 2410 0 0 0 0 0 15411640 1412224 0 0 0 0 0 0 0 0 2 1 0 4585 1898 2642 0 0 52 © 2013 Pythian - Presentation for OakWorld id 92 100 100
  • 52. Memstat (mdb) bash-3.00# mdb -k Loading modules: [ unix genunix specfs dtrace zfs sd mpt px ldc ip hook neti sctp arp usba fctl nca lofs cpc random crypto fcip logindmux ptm ufs sppp nfs ipc ] > ::memstat Page Summary Pages MB %Tot --------------------------- ---------------- ---Kernel 215755 1685 11% ZFS File Data 343278 2681 17% File Cache Anon 1214036 9484 59% Oracle SGA Exec and libs 52228 408 3% Page cache 32394 253 2% Free (cachelist) 66268 517 3% Free (freelist) 118696 927 6% Total Physical 53 2042655 2011811 15958 15717 © 2013 Pythian - Presentation for OakWorld
  • 53. ipcs / sysresv • ipcs –a (OS tool) • Both Solaris and Linux • Shows all Shared Memory Segments, sempahors etc. • ipcrm can remove orphan segments • sysresv (Oracle tool) • Reports semaphors and keys for current ORACLE_SID 54 © 2013 Pythian - Presentation for OakWorld
  • 54. ipcs ipcs –a ------ Shared Memory Segments -------key shmid owner perms status 0x00000000 0 root 644 0x00000000 32769 root 644 0x00000000 65538 root 644 0xed304ac0 163844 oracle 660 0x466ff99c 557061 oracle 660 72 2 16384 2 280 2 4096 0 26845642752 182 ------ Semaphore Arrays -------key semid owner perms 0x869d3e0c 131073 oracle 660 0x869d3e0d 163842 oracle 660 nsems 125 125 55 © 2013 Pythian - Presentation for OakWorld bytes nattch
  • 55. sysresv sysresv IPC Resources for ORACLE_SID "qadw1" : Shared Memory: ID KEY 557061 0x466ff99c Semaphores: ID KEY 2490378 0xd9773da4 2523147 0xd9773da5 2555916 0xd9773da6 ... 56 © 2013 Pythian - Presentation for OakWorld
  • 56. Linux /proc/meminfo MemTotal: MemFree: Buffers: Cached: SwapCached: Active: Inactive: HighTotal: HighFree: LowTotal: LowFree: SwapTotal: SwapFree: Dirty: Writeback: AnonPages: 57 74 027 752 20 683 044 654 908 37 806 532 101 112 34 262 824 9 524 280 0 0 74 027 752 20 683 044 16 771 852 16 670 740 14 328 0 5 222 736 kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB Mapped: 24 687 736 kB Slab: 1 371 528 kB PageTables: 7 843 932 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 53 785 728 kB Committed_AS: 43 555 536 kB VmallocTotal: 34 359 738 367 kB VmallocUsed: 290 700 kB VmallocChunk: 34 359 447 655 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 Hugepagesize: 2048 kB © 2013 Pythian - Presentation for OakWorld
  • 57. Linux /proc/meminfo Newer MemTotal: MemFree: Buffers: Cached: SwapCached: Active: Inactive: HighTotal: HighFree: LowTotal: LowFree: SwapTotal: SwapFree: Dirty: Writeback: AnonPages: 58 16 344 972 13 634 064 3 656 1 195 708 0 891 636 1 077 224 15 597 528 13 629 632 747 444 4 432 0 0 968 0 861 800 kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB Mapped: Slab: SReclaimable: SUnreclaim: PageTables: NFS_Unstable: Bounce: WritebackTmp: CommitLimit: Committed_AS: VmallocTotal: VmallocUsed: VmallocChunk: © 2013 Pythian - Presentation for OakWorld 280 284 159 124 24 7 669 100 112 111 372 364 856 508 448 0 0 0 796 056 216 428 088 kB kB kB kB kB kB kB kB kB kB kB kB kB
  • 58. MemTotal • Total memory available to Linux • Excludes reserved region • If not what you expect – check the DIMM‘s. They do occasionally die. 59 © 2013 Pythian - Presentation for OakWorld
  • 59. MemFree • Wasted memory • Memory not currently in use by anything • May be removed from the system as it provides no benefit • Memory immediately available to be used by a process touching memory • Will be used by any non-directIO filesystem read • Will be consumed until approaches /proc/sys/vm/min_free_kbytes 60 © 2013 Pythian - Presentation for OakWorld
  • 60. MemFree – example grep MemFree /proc/meminfo MemFree: 26 568 kB echo 900000 > /proc/sys/vm/min_free_kbytes grep MemFree /proc/meminfo MemFree: 210 056 kB 61 © 2013 Pythian - Presentation for OakWorld
  • 61. Buffers • Cache of raw disk blocks • Usually occupied with ext3 metadata • Mostly ext3 pointers (extent management) • Not the cache of actual user data • Should be relatively low (400Mb) on ASM systems as filesystem metadata is inside ASM • Unless filesystem used for backups, or other data 62 © 2013 Pythian - Presentation for OakWorld
  • 62. Cached • Memory that is copied from disk to RAM • File system cache • Binaries been executed • Can be dirty i.e. Requires disk writes to be released • If not dirty, can be very quickly released when programs request memory • Will include the Oracle SGA if not using hugepages 63 © 2013 Pythian - Presentation for OakWorld
  • 63. Cached – example 1 [root@ ~]# cat /proc/meminfo … MemFree: 8232512 kB Buffers: 9328 kB Cached: 28372 kB … du -smc indx01_* 1714 indx01_01.dbf 1761 indx01_02.dbf 1722 indx01_03.dbf 5197 total … cat indx01_* > /dev/null 64 © 2013 Pythian - Presentation for OakWorld
  • 64. Cached – example 2 [root@ ~]# vmstat 2 procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 8093888 10808 163392 0 0 0 0 1012 17 0 0 100 0 0 0 0 8093952 10808 163392 0 0 0 0 1012 16 0 0 100 0 0 1 0 7956736 10948 300272 0 0 68602 0 1567 1126 0 2 76 22 0 1 0 7808576 11092 448068 0 0 73992 80 1623 1210 0 2 75 23 … 0 1 0 2847616 16104 5397616 0 0 65792 0 1542 1076 0 2 75 23 0 0 0 2766272 16180 5479180 0 0 40698 0 1341 675 0 1 85 14 0 0 0 2766208 16192 5479168 0 0 0 114 1033 22 0 0 100 0 cat /proc/meminfo … MemFree: 2766464 kB Buffers: 16192 kB Cached: 5479168 kB … 65 © 2013 Pythian - Presentation for OakWorld
  • 65. Cached writing – example cat indx01_* >newfile vmstat 2 procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 2765312 17044 5479356 0 0 0 0 1012 17 0 0 100 0 0 3 0 2405376 17428 5833612 0 0 16 36866 1324 144 1 18 76 6 0 2 0 2143616 17688 6091532 0 0 4 111748 2000 213 0 16 50 34 … 0 1 0 16832 6784 8198556 0 0 8556 26684 1942 1267 0 2 74 24 1 1 0 16832 6856 8198744 0 0 12518 20720 2130 1767 0 3 74 23 … cat /proc/meminfo … MemFree: 16768 kB Buffers: 2192 kB Cached: 8196908 kB … Dirty: 277468 kB Writeback: 0 kB … 66 © 2013 Pythian - Presentation for OakWorld
  • 66. Cached removing file cat /proc/meminfo … MemFree: 20672 Buffers: 3300 Cached: 8191900 … Dirty: 0 Writeback: 0 … kB kB kB kB kB rm newfile procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 23296 3380 8189480 0 0 0 28 1015 18 0 0 100 0 0 1 0 3257472 3948 4996372 0 0 284 0 1084 160 0 14 78 8 0 1 0 3255552 5828 4996572 0 0 940 0 1247 485 0 1 75 24 0 1 0 3253696 7616 4996344 0 0 884 96 1237 470 0 2 75 23 0 0 0 3253440 7988 4996492 0 0 186 0 1061 112 0 0 95 4 0 0 0 3253440 7988 4996492 0 0 0 0 1012 14 0 0 100 0 67 © 2013 Pythian - Presentation for OakWorld
  • 67. Commited_AS / CommitLimit • Committed_AS • Total memory requested on the system • Not used, just requested • If every process in the system is to touch and use the memory it has requested, this is how much would be used • CommitLimit • Total memory that can be requested • Should factor over allocate • Memory allocation errors* when you reach limit – (overcommit_memory) 70 © 2013 Pythian - Presentation for OakWorld
  • 68. Commit_AS example cat grab.c main() {void *p; p=malloc(1073741824); sleep(60);} cat /proc/meminfo ... MemFree: 3 230 592 kB ... Committed_AS: 49 972 kB ./grab cat /proc/meminfo ... MemFree: 3 230 464 kB ... Committed_AS: 1 098 808 kB 71 © 2013 Pythian - Presentation for OakWorld
  • 69. Slab • Slab – ―in-kernel data structures cache‖ • similar to Oracle‘s ―shared_pool‖ • designed to prevent memory fragmentation • detailed monitoring: /proc/slabinfo slabtop • Basically ―system space‖ 72 © 2013 Pythian - Presentation for OakWorld
  • 70. slabtop example Active / Total Objects (% used) Active / Total Slabs (% used) Active / Total Caches (% used) Active / Total Size (% used) Minimum / Average / Maximum Object OBJS ACTIVE USE OBJ SIZE 32382 24900 76% 0.27K 56925 40013 70% 0.05K 364 363 99% 4.00K 2485 2471 99% 0.54K 2376 413 17% 0.50K 256 256 100% 3.00K 4576 4481 97% 0.15K 10248 4548 44% 0.06K 4340 1215 27% 0.12K 1980 316 15% 0.25K … 73 : : : : : 88874 / 139343 (63.8%) 5839 / 5846 (99.9%) 90 / 132 (68.2%) 17286.03K / 23311.27K (74.2%) 0.01K / 0.17K / 128.00K SLABS OBJ/SLAB CACHE SIZE NAME 2313 14 9 252K radix_tree_node 759 75 3 036K buffer_head 364 1 1 456K size-4096 355 7 1 420K ext3_inode_cache 297 8 1 188K size-512 128 2 1 024K biovec-(256) 176 26 704K dentry_cache 168 61 672K size-64 140 31 560K size-128 132 15 528K size-256 © 2013 Pythian - Presentation for OakWorld
  • 71. HugePages • HugePages_Total • HugePages_Free • HugePages_Rsvd • Allocated but untouched pages • Must have Rsvd amount FREE hugepages or bad things happen to Oracle • Hugepages are: • Locked in memory • 512 larger than regular 4KiB pages • Requires 512 times less PTE Entries 74 © 2013 Pythian - Presentation for OakWorld
  • 72. HugePages - Example • Config: • 1.7 Gb sga (max on 32 bit without VLM) • 1400 Mb in db_cache_size • table sized to fit exactly in cache • Test • Start 100 sessions, • full scan test table (cached) in order to touch the memory and allocate the PTEs • Sessions will wait via dbms_lock.allocate to be released • Show before and after PageTables usage 75 © 2013 Pythian - Presentation for OakWorld
  • 73. HugePages - Example Before starting the sessions (db is UP) cat /proc/meminfo … MemFree: 1 070 472 kB PageTables: 4 932 kB After sessions have finished touching the memory cat /proc/meminfo … MemFree: 473 496 kB PageTables: 295 068 kB 76 © 2013 Pythian - Presentation for OakWorld
  • 74. PTE Tables • Page Table Entries • • • Per process non-shareable (except ISM solaris) Minimum 16 bytes in size* 100 processes (read sessions) mapping 200 GiB of SGA 200*1024*1024/4 = 52‘428‘800 (4KiB pages) * 16 bytes 800 MiB PER PROCESS Total: 80’000 MiB • 77 With HugePages • 1600 KiB per process Total: 156 Mib A New Page Table for 64-bit Address Spaces Madhusudhan Talluri, Sun, http://citeseerx.ist.psu.edu/viewdoc/download?doi=10. 1.1.110.4178&rep=rep1&type=pdf © 2013 Pythian - Presentation for OakWorld
  • 76. CGROUPS • Linux resource manager Supports: blkio — this subsystem sets limits on input/output access to and from block devices such as physical drives (disk, solid state, USB, etc.). cpu — this subsystem uses the scheduler to provide cgroup tasks access to the CPU. cpuacct — this subsystem generates automatic reports on CPU resources used by tasks in a cgroup. cpuset — this subsystem assigns individual CPUs (on a multicore system) and memory nodes to tasks in a cgroup. devices — this subsystem allows or denies access to devices by tasks in a cgroup. freezer — this subsystem suspends or resumes tasks in a cgroup. memory — this subsystem sets limits on memory use by tasks in a cgroup, and generates automatic reports on memory resources used by those tasks. net_cls — this subsystem tags network packets with a class identifier (classid) that allows the Linux traffic controller (tc) to identify packets originating from a particular cgroup task. net_prio — this subsystem provides a way to dynamically set the priority of network traffic per network interface. ns — the namespace subsystem 79 © 2013 Pythian - Presentation for OakWorld
  • 77. CGROUPS – memory • Hierarchical memory control • Inherited • Includes shared pages • Includes file system cache • Includes SWAP • Can include KERNEL (slab, sockets, stack) 80 © 2013 Pythian - Presentation for OakWorld
  • 78. CGROUPS – memory • memory.usage_in_bytes • memory.memsw.usage_in_bytes • memory.oom_control • memory.soft_limit_in_bytes • Notifier • low/medium/critical 81 © 2013 Pythian - Presentation for OakWorld
  • 79. CGROUPS – testing • Mount memory cgroup module (doc) • Create cgroup ―0‖ • echo ―$$‖ of bash to 0/task • startup database • Run: wile [[ 1 ]] ; do echo $((`cat memory.memsw.usage_in_bytes`/1000000 )) ; sleep 1 ; done 82 © 2013 Pythian - Presentation for OakWorld
  • 80. CGROUPS – example 1 867 SQL> create tablespace mytest datafile size 1g; Tablespace created. SQL> 1871 83 © 2013 Pythian - Presentation for OakWorld
  • 81. CGROUPS – shutdown 1872 SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. 1077 84 © 2013 Pythian - Presentation for OakWorld
  • 82. CGROUPS – file delete 1862 SQL> drop tablespace mytest; Tablespace dropped. 789 85 © 2013 Pythian - Presentation for OakWorld
  • 83. CGROUPS – direct IO 798 SQL> create tablespace mytest datafile size 1g; Tablespace created. 798 86 © 2013 Pythian - Presentation for OakWorld
  • 84. CGROUPS – direct path 799 SQL> insert /*+APPEND*/ into t1 select * from t1; 331040 rows created. SQL> commit; Commit complete. 799 87 © 2013 Pythian - Presentation for OakWorld
  • 85. CGROUPS – 4g alter system set memory_target=4g scope=spfile; System altered. startup 2597 88 © 2013 Pythian - Presentation for OakWorld
  • 86. CGROUPS – sga init 4939 622 SQL> select count(*) from t1; --"_serial_direct_read" = never; 5158 5158 … 5158 5158 5159 89 664 680 844 904 973 © 2013 Pythian - Presentation for OakWorld
  • 88. Oracle views • V$PROCESS • PGA_USED_MEM,PGA_ALLOC_MEM, PGA_FREA BLE_MEM, PGA_MAX_MEM • V$PROCESS_MEMORY • PL/SQL vs SQL vs Other • V$PROCESS_MEMORY_DETAIL • Not populated • Requires event ―PGA_DETAIL_GET― to be set • Only for testing 91 © 2013 Pythian - Presentation for OakWorld
  • 89. Thank you and Q&A To contact us… sales@pythian.com 1-877-PYTHIAN To follow us… http://www.pythian.com/news/ http://www.facebook.com/pages/The-Pythian-Group/163902527671 @pythian @pythianjobs http://www.linkedin.com/company/pythian © 2009/2010 Pythian - Presentation for ABC Company