Thanks for the information. Knut, do you mean that this table cache mechanism is not supported yet in the current release of Derby and will be supported in future release?
Yifan -----邮件原件----- 发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 发送时间: 2007年2月21日 8:21 收件人: [email protected] 主题: Re: The size of caches for dataDictionary Stanley Bradbury <[EMAIL PROTECTED]> writes: > Yifan wrote: >> >> I have looked into the code for data dictionary. In the source code, >> there are some caches for tables or columns. >> >> One thing I am a little confused is the size of these caches. >> >> For example, if there is no DDL statement but only DML statement >> which manipulate on all tables, will the table cache keep all tables >> in memory or just part of them? >> >> If we do not have enough memory, will table belong to further DML >> statement being cached or not? >> >> >> >> Thanks >> >> Yifan >> > The setting of pageCacheSize determines the number of pages that will > be held in the data cache. New pages needed to satisfy the DML > executed will be added to the cache until the pageCacheSize limit is > reached. At this point the LRU pages in the cache will be removed to > make room for newly referenced pages. > > Theoretically, if the pageCacheSize is larger than the size of all the > tables and indexes in the database , all the the tables could become > loaded into the cache and remain there until Derby is shutdown. I'll just add that the table cache Yifan observed in the data dictionary (which is not the same as the page cache) only contains metadata describing the tables. So even when that cache contains information about all the tables, it should consume just a small amount of memory compared to the total storage space required by the tables. By default, the table cache contains at most 64 table descriptors. The table cache uses the same LRU-like algorithm as the page cache to keep the most recently referenced table descriptors in memory. -- Knut Anders
