sort_area_retained_size之tom解释

 sort_area_retained_size 摘录一段asktom中tom的解释,对sort内存分配的方式进行了描述:

it will allocate up to sort_area_retained_size in the UGA and the spill over into the "pure" PGA up to sort_area_size if the sort exceeds the sort_area_retained_size AND sort_area_size is greater then sort_area_retained_size.
 
the sort_area_retained_size parameter is often misunderstood. At a high level, this is what happens:
 
to do a sort, Oracle allocates chunks of memory up to a maximum of sort_area_size.
 
As each chunk is allocated -- Oracle checks to see if the sort area is less then the sort_area_retained_size.
 
If so, this chunk is allocated in memory that survives from call to call (in the UGA -- where ever the UGA might be -- in the pga or sga). This memory survives as long as needed (across many calls potentially to fetch rows and such)
 
If not, this chunk is allocated in the "pure pga" and freed at the end of the call. This memory does not survive across calls at all.
 
Sort area memory is not necessarily contigous memory -- hence bits of it could be in the SGA, some in the PGA -- it matters not to Oracle.
 
see also

猜你喜欢

转载自www.cnblogs.com/simple-oracle/p/10687487.html
tom