博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PL/SQL Virtual Machine Memory Usage
阅读量:5947 次
发布时间:2019-06-19

本文共 2392 字,大约阅读时间需要 7 分钟。

PL/SQL Program Units即PL/SQL程序单元,常被叫做"library units"或lib-units. 参考以下模块类型:
  • package spec
  • package body
  • top-level function or procedure
  • type spec
  • type body
  • trigger
  • anonymous blocks.
PL/SQL 虚拟机的内存使用主要体现在4个方面:
  • PGA
    • PL/SQL stack call,用于保存本地变量和其他一些状态结构
    • NCOMP生成的动态链接库文件
  • CGA
    • 二级内存(secondary memory),分配的堆和大的可收缩本地变量如大的strings、Lob或collections
  • UGA
    • 程度单元的实例(library-unit instantiations),如package global variables, DL0/ DL1 dependency vectors, display frame等
  • SGA 共享池中的MCODE子堆
KGL - Kernel Generic Library Manager 该layer管理会话间需要共享的资源,如PL/SQL MCODE,Diana,Source,SQL cursor,SQL Plan) KGI - Kernel Generic Instantiation Layer. 该layer管理特定会话非共享的资源,如实例化的包含了包全局变量状态信息的PL/SQL程序单元 KOH/KGH 该layer用以管理heap service堆服务
   
PLSQL MCODE Heap的属性
  • machine dependent binary format for a compiled PL/SQL library-unit.
  • to execute code in a lib-unit, its MCODE heap must be loaded in memory.
  • MCODE is loaded in SGA and is “pinned” for CALL duration.
  • once unpinned, the heap may be aged; hence, may need to get re-loaded.
  • important to page large data structures in SGA.
MCODE Heap: Subcomponents
  • EntryPoint Piece (PL_UEP)
  • Code Segment or Byte Code Piece (PL_UCP)
  • Constant Pool:
    • Data Segment (PL_UKP)
    • Handle Segment (PL_UHS)
  • SQL Strings Table (PL_USP)
PL/SQL Instantiations
  • When a lib-unit is first referenced by a program (session) an instantiation of the lib unit is created.
  • PL/SQL relies on KGI for inst obj mgmt.
  • A PL/SQL lib-unit instantiation consists of:
    • PLIO struct (the handle of the PL/SQL inst obj)
    • Static Frame
    • Secondary (Heap) Memory for package globals
  • PLIO Struct
    • first portion of PLIO struct is the KGIOB struct (kgi’s portion of the object handle)
    • points to the static frame struct (PLIOST)
    • also contains other book-keeping info (such as memory duration of instantiation’s work area, etc.)
  • Static Frame:
    • represents that part of instantiation’s work area whose size is compile-time determined.
    • the root of the static frame is PLIOST struct which leads the following sub-pieces:
      • depends-on array to global variable vectors (DL0)
      • depends-on array to other instantiations (DL1)
      • Display Frame (DPF)
      • global variable vector for this unit (GF)
      • primary memory for global variables.
  • Secondary Memory for package globals
    • used to allocate data types that are stored out-of-line (heap allocated)e.g., collections, large strings, large records, LOBs, datetime types, etc.

 

本文转自maclean_007 51CTO博客,原文链接:http://blog.51cto.com/maclean/1277854

转载地址:http://ybdxx.baihongyu.com/

你可能感兴趣的文章
log4j典型配置快速上手笔记
查看>>
如何提高团队代码质量——代码审查的实践
查看>>
公司对外若干台web服务器,发现有人恶意刷新页面,怎么办?
查看>>
五指cms标签说明汇总
查看>>
oracle 客户端安装
查看>>
CentOS minimal安装和开发环境部署
查看>>
JavaScript 日期格式化显示
查看>>
JSP与struts2跳转兼容问题
查看>>
我的友情链接
查看>>
Python实现斐波那契数列
查看>>
JMeter和LoadRunner的异同
查看>>
sed处理文本
查看>>
jquery 操作iframe、frameset
查看>>
解决vim中不能使用小键盘
查看>>
jenkins权限管理,实现不同用户组显示对应视图views中不同的jobs
查看>>
我的友情链接
查看>>
CentOS定时同步系统时间
查看>>
批量删除用户--Shell脚本
查看>>
如何辨别android开发包的安全性
查看>>
Eclipse Java @Override 报错
查看>>