You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2009/04/01 14:01:13 UTC

[jira] Created: (JCR-2051) Disk based transient space

Disk based transient space
--------------------------

                 Key: JCR-2051
                 URL: https://issues.apache.org/jira/browse/JCR-2051
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-core
            Reporter: Marcel Reutegger
            Priority: Minor


Currently the transient space in jackrabbit-core is held completely in memory. This limits the number of items that can be part of a save call. The memory usage for the transient space should be lowered significantly, e.g. by writing item states to a swap file on a disk.

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


[jira] Commented: (JCR-2051) Disk based transient space

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694495#action_12694495 ] 

Marcel Reutegger commented on JCR-2051:
---------------------------------------

Here's my proposal for an implementation:

- have a map that references (hard or weak) all transient item states
- keep hard references to N most recently used item states
- if item state drops out of most recently used map turn its reference into a weak one and swap out the item state
- on request of an item state, either return the hard referenced item state or resolve the weak reference into an item state read from disk

> Disk based transient space
> --------------------------
>
>                 Key: JCR-2051
>                 URL: https://issues.apache.org/jira/browse/JCR-2051
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>
> Currently the transient space in jackrabbit-core is held completely in memory. This limits the number of items that can be part of a save call. The memory usage for the transient space should be lowered significantly, e.g. by writing item states to a swap file on a disk.

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


[jira] Commented: (JCR-2051) Disk based transient space

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694536#action_12694536 ] 

Marcel Reutegger commented on JCR-2051:
---------------------------------------

> if the ItemState is gc'ed because it is no longer externally referenced), the changes will
> be lost since the  serialized copy on disk does not reflect the changes made after it was 
> created.

right. that part is missing in my proposal. but it can be solved by registering an item state listener
that gets callbacks when an item state changes. If the callback is for a weakly referenced item state,
then the serialized copy needs to be updated.


> Disk based transient space
> --------------------------
>
>                 Key: JCR-2051
>                 URL: https://issues.apache.org/jira/browse/JCR-2051
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>
> Currently the transient space in jackrabbit-core is held completely in memory. This limits the number of items that can be part of a save call. The memory usage for the transient space should be lowered significantly, e.g. by writing item states to a swap file on a disk.

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


[jira] Commented: (JCR-2051) Disk based transient space

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694520#action_12694520 ] 

Stefan Guggisberg commented on JCR-2051:
----------------------------------------

i absolutely agree about this feature/improvement in general.

i started implementing a disk-backed item store about 2 years ago. 
i tried to keep the changes locally to TransientItemStateManager
by implementing a DiskBackedItemStateStore using ehcache 
(very similar to your proposal). eventually i had to give up since i 
came to the conclusion that it's not possible to accomplish without 
major changes in jackrabbit's internal state-handling design.

FWIW, here are my findings:

let's assume an ItemState got evicted to disk and its reference turned 
into a weak one.  that ItemState might still be referenced by an ItemImpl 
instance and hence modified. if the ItemState is gc'ed because it is
no longer externally referenced), the changes will be lost since the 
serialized copy on disk does not reflect the changes made after it was 
created.

in order to avoid this, the ItemState should only be evicted to disk 
when the object is no longer referenced, ... which is AFAIK technically
impossible.





> Disk based transient space
> --------------------------
>
>                 Key: JCR-2051
>                 URL: https://issues.apache.org/jira/browse/JCR-2051
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>
> Currently the transient space in jackrabbit-core is held completely in memory. This limits the number of items that can be part of a save call. The memory usage for the transient space should be lowered significantly, e.g. by writing item states to a swap file on a disk.

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