[ 
https://issues.apache.org/jira/browse/DERBY-3130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-3130:
--------------------------------------

    Attachment: SmallRecordsTest.java

Attached is a test which fills a table with 500000 small records (consisting of 
a single int) and than waits for the user to press enter before it finishes. 
With a default sized page cache (4000 pages), this is what jmap -histo:live 
says about the contents of the heap when all the records have been inserted 
(Sun Java 6, 32-bit):

num   #instances    #bytes  class name
--------------------------------------
  1:    136814     6567072  
org.apache.derby.impl.store.raw.data.StoredRecordHeader
  2:      5239     4568104  [B
  3:     14465     1447800  <constMethodKlass>
  4:     14465     1158248  <methodKlass>
  5:     17416      808920  <symbolKlass>
  6:      1000      559280  
[Lorg.apache.derby.impl.store.raw.data.StoredRecordHeader;

The page cache is expected to contain ~4MB of byte arrays, but the 
StoredRecordHeader objects consume even more memory, ~6.5MB.

> Reduce memory footprint of StoredRecordHeader
> ---------------------------------------------
>
>                 Key: DERBY-3130
>                 URL: https://issues.apache.org/jira/browse/DERBY-3130
>             Project: Derby
>          Issue Type: Improvement
>          Components: Store
>    Affects Versions: 10.4.0.0
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: SmallRecordsTest.java
>
>
> Derby's page cache often has a memory footprint that is much larger than 
> pageSize*pageCacheSize. One large contributor to the footprint is the array 
> of StoredPageHeader objects in BasePage. The memory consumed by these objects 
> can be as large as, and sometimes even larger than, the byte arrays 
> containing the raw page data. (See for instance 
> http://www.nabble.com/How-much-derby-need-memory--tf3307655.html.) Reducing 
> the size of the StoredPageHeader objects could therefore reduce Derby's 
> memory footprint significantly, especially if the page cache is large and 
> contains many pages from tables with small records or from indices.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to