Oracle Granule Size

granule is a unit of contiguous virtual memory allocated to a process.

Oracle instance

If an Oracle instance starts up, it allocates the SGA (System Global Area) in granule sized memory units. The size of these granules depends on your database version and somtimes even on the operating system port. For example, for Oracle 9i it is typically 4MB if your SGA is smaller than 128MB and 16MB if your SGA is bigger. For later releases it is typically 4MB if your SGA is smaller than 1GB and 16MB if your SGA is bigger. Issue the below query to get your instance’s exact granule size:

SQL> SELECT * FROM v$sgainfo WHERE name = 'Granule Size';
NAME                                  BYTES RES
-------------------------------- ---------- ---
Granule Size                        4194304 No

The minimum SGA size is three granules, based on:

  1. One Granule for Fixed SGA (includes redo buffers)
  2. One Granule for Buffer Cache
  3. One Granule for the Shared Pool

The maximum SGA size is determined by the sga_max_size parameter.

SQL> show parameter sga_max_size;
NAME                                 TYPE        VALUE
———————————— ———– ——————————
sga_max_size                         big integer 328M

SQL> show parameter sga_max_size;

NAME                                               TYPE        VALUE

———————————— ———– ——————————

sga_max_size                              big integer 328M

Note that Oracle will always round-up memory values to the next granule size. The Buffer Cache, Shared Pool, Large Pool and Java Pool, to name a few, can only grow or shrink based on granule boundaries.

评论 (2)

  • Glinda Marlett| 2010年6月28日

    楼主的帖子实在是写得太好了。文笔流畅,修辞得体,深得魏晋诸朝遗风,更将唐风宋骨发扬得入木三分,能在有生之年看见楼主的这个帖子。实在是我三生之幸啊。看完楼主的这个帖子之后,我竟产生出一种无以名之的悲痛感——啊,这么好的帖子,如果将来我再也看不到了,那我该怎么办?那我该怎么办?直到我毫不犹豫地把楼主的这个帖子收藏了,我内心的那种激动才逐渐平静下来。可是我立刻想到,这么好的帖子,倘若别人看不到,那么不是浪费楼主的心血吗?经过痛苦的思想斗争,我终于下定决心,牺牲小我,奉献大我。我要拿出这帖子奉献给世人赏阅,我要把这个帖子一直往上顶,往上顶!顶到所有人都看到为止!

  • Rix Chan| 2014年3月24日

    英文太差,没太看懂……只看懂分配内存大小是以granule size为单位进行分配。

  • 发表评论

    邮箱地址不会被公开。 必填项已用*标注