cancel
Showing results for 
Search instead for 
Did you mean: 

Where in memory is the LRU stored?

peter_strauss
Participant
0 Kudos

Hello,

In what memory area are LRUs stored?

Kind regards,

Peter

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Peter,

let me provide you with some more insight on the Oracle buffer pool LRU (because your question is actually quite interesting):

- The LRU list (like some other buffer pool block lists) is closely related to the fixed object X$BH (that is e.g. accessed with V$BH and contains the block header information).

- X$BH contains some pointer columns (*_NXT, *_PRV) that are used to connect different blocks for the different lists.

- If the Oracle parameter DB_BLOCK_BUFFERS is used, the X$BH information is stored in the component "db_block_buffers" that is part of the shared pool. In fact it is allocated on top of the defined SHARED_POOL_SIZE (see note 789011 (6)) what can be a little bit confusing.

- If the Oracle parameter DB_CACHE_SIZE is used, the X$BH information is directly stored in the granules of the Oracle buffer pool. So the net storage space of the buffer pool is slightly smaller than with DB_BLOCK_BUFFERS.

Kind regards

Martin

peter_strauss
Participant
0 Kudos

Hello Martin,

Thank you. Plenty of food for thought there.

Kind regards,

Peter

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Peter,

I'm surprised that the second link satisfied you, because it speaks about the BW OLAP Cache what is something completely different from the Oracle Buffer Pool. Or have I missed something here?

Regards

Martin

peter_strauss
Participant
0 Kudos

Hello Martin,

I was just pretending I understood.

The link does mention something about LRU after all!

Take the following from http://download.oracle.com/docs/cd/B14117_01/server.101/b10743/memory.htm

"The buffers in the cache are organized in two lists: the write list and the least recently used (LRU) list. The write list holds dirty buffers, which contain data that has been modified but has not yet been written to disk. The LRU list holds free buffers, pinned buffers, and dirty buffers that have not yet been moved to the write list."

Are the lists mentioned a physical ordering of the data buffers or is there external organization involved, like an actual list referencing the blocks?

To me it would make more sense to have an external reference, because you'd be able to reorganize by simply rewriting references. But then the sentence makes it sound like there is an internal organization of the memory.

Kind regards,

Peter

Former Member
0 Kudos

Dear Peter,

LRU is not stored in any particular location or part of the Shared memory,

LRU is Least Recently Used. As and when the shadow processed load data in the Database buffer, the memory is allocated based on certain memory allocation techniques (8K blocks in SAP).

These blocks will be moved around by Oracle as and when required, to create larger contiguous space etc in the memory aswell.

LRU is simply comparing the timestamp of the data and deciding when was it used last.

So the answer to your qsn qould be LRU,s are in the Database Buffer. But no specific LRU area is allocated to them.

Regards

Shantanu

peter_strauss
Participant
0 Kudos

Hello Shantanu,

Thank you for your reply.

> So the answer to your qsn qould be LRU,s are in the Database Buffer.

Where else could they be?

They are lists letting shadow processes know which blocks in the data cache have been least used, and which blocks are dirty. So they must exist somewhere. Is it in the data buffer or somewhere else?

Idle curiosity at work here.

Kind regards,

Peter

Former Member
0 Kudos

Like I said Peter,

Each time data is loaded into the database buffer, it is associated with the time stamp of when it was last used. There is no specific area allocated, where LRU's are first moved to in the DB Buffer so they might be all over the DB buffer. As long as the timestamp is valid, the shadow processes can detect which ones have not been used for a long time.

Regards

Shantanu

peter_strauss
Participant
0 Kudos

Hey Shantanu,

Thanks again.

In that case, where is the timestamp held?

Sorry for being pedantic.

Regards,

Peter

peter_strauss
Participant
0 Kudos

I'm not entirely convinced that there aren't actual 'lists' managing the process.

The material I'm going off is based on 9i so something might have changed with 10g, however:

I'm faced with the concept of latch wait time for processes that have to wait for a latch on one of what could be multiple LRU lists.

If there aren't actual LRU lists how can you have multiple lists?

Also, for implementing latches I think it's more likely (I've been wrong a thousand times though ) that you would actual lists in existence.

Kind regards,

Peter

Former Member
0 Kudos

Hey Peter

No need to be apologetic, refreshed my memory a bit too in the process hehe

Please refer to these links

http://help.sap.com/saphelp_nw70/helpdata/en/43/662103660b0398e10000000a1553f6/frameset.htm

http://help.sap.com/saphelp_nw70/helpdata/en/d5/5a393de3bb752de10000000a114084/frameset.htm

Hope these help

Regards

Shantanu

Former Member
0 Kudos

You are absolutely right Peter,

However, the lists only contain meta data and not the actual data

Regards

Shantanu

peter_strauss
Participant
0 Kudos

Hello Shantanu,

The second link you gave was very helpful, but I'm going to have to go over it a few times before I really get the hang of it.

Basically it looks like the cache is sorted in a list (or lists depending on the configuration) to which an algorithm is applied based on flags that appear to be in the memory blocks themselves.

Interesting.

I wont think about it too much more now because I don't want to get a headache. I'm sure it will all seem much clearer at a later date.

Regards,

Peter