jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Müller <thomas.muel...@day.com>
Subject Re: Garbage Collection not deleting until restart of server
Date Thu, 12 Nov 2009 10:33:14 GMT
Hi,

I think what the problem is.

The data store keeps a list of 'recently used items' in a weak hash
map (FileDataStore.inUse). "All data identifiers that are currently in
use are in this set until they are garbage collected." Garbage
collection here means Java garbage collection. That means as long as
the identifiers are in the Java heap, the files are not deleted.

The test cases call FileDataStore.clearInUse(), however this shouldn't
be used for production, just for testing.

If you want to ensure all files are deleted, an option is to call
System.gc() a few times before running the data store garbage
collection.

Regards,
Thomas



On Thu, Nov 12, 2009 at 11:26 AM, Euan Green <euangreen@gmail.com> wrote:
>
>>Thanks! You wrote that some files are still there after the data store
>>garbage collection ran, but they are removed after restarting Tomcat.
>>Did I understand that correctly? That's strange because the data store
>>only deletes files during the deleteUnused() call, never at startup.
>>Unless, your application calls deleteUnused() at startup. Could you
>>provide file listing (dir /s I believe) of the datastore directory
>>before calling garbage collection, after calling garbage collection,
>>and after restarting Tomcat?
>
> Hi, I wasn't probably clear enough. I run a Garbage Collection process  from
> a batch file every minute (the method is contained within the same
> application that will adds to the repository), so after restarting the
> application the GarbageCollection will run and the files will be deleted. If
> I add a new item to the datastore AFTER I have restarted the the application
> this new one is NOT removed when Garbage Colelction first runs, but the old
> one is.
>
> See below for file listings you asked for.
>
> Regards,
>
> Euan
>
> Before garbage collection:
> C:\apache-tomcat-5.5.26\repository\repository\datastore>dir /s
>  Volume in drive C has no label.
>  Volume Serial Number is 0408-167E
>
>  Directory of C:\apache-tomcat-5.5.26\repository\repository\datastore
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:13    <DIR>          db
>               0 File(s)              0 bytes
>
>  Directory of C:\apache-tomcat-5.5.26\repository\repository\datastore\db
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:13    <DIR>          a3
>               0 File(s)              0 bytes
>
>  Directory of C:\apache-tomcat-5.5.26\repository\repository\datastore\db\a3
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:13    <DIR>          b4
>               0 File(s)              0 bytes
>
>  Directory of
> C:\apache-tomcat-5.5.26\repository\repository\datastore\db\a3\b4
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:13         1,855,295 dba3b49091e3fc230c352efe019aecf1f421aa8b
>               1 File(s)      1,855,295 bytes
>
>     Total Files Listed:
>               1 File(s)      1,855,295 bytes
>              11 Dir(s)  69,862,002,688 bytes free
>
>
> After Garbage Collection:
> C:\apache-tomcat-5.5.26\repository\repository\datastore>dir /s
>  Volume in drive C has no label.
>  Volume Serial Number is 0408-167E
>
>  Directory of C:\apache-tomcat-5.5.26\repository\repository\datastore
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:13    <DIR>          db
>               0 File(s)              0 bytes
>
>  Directory of C:\apache-tomcat-5.5.26\repository\repository\datastore\db
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:13    <DIR>          a3
>               0 File(s)              0 bytes
>
>  Directory of C:\apache-tomcat-5.5.26\repository\repository\datastore\db\a3
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:13    <DIR>          b4
>               0 File(s)              0 bytes
>
>  Directory of
> C:\apache-tomcat-5.5.26\repository\repository\datastore\db\a3\b4
>
> 12/11/2009  10:13    <DIR>          .
> 12/11/2009  10:13    <DIR>          ..
> 12/11/2009  10:16         1,855,295 dba3b49091e3fc230c352efe019aecf1f421aa8b
>               1 File(s)      1,855,295 bytes
>
>     Total Files Listed:
>               1 File(s)      1,855,295 bytes
>              11 Dir(s)  69,861,986,304 bytes free
>
> After Garbage Collection has first run after restart of server:
> C:\apache-tomcat-5.5.26\repository\repository\datastore>dir /s
>  Volume in drive C has no label.
>  Volume Serial Number is 0408-167E
>
>  Directory of C:\apache-tomcat-5.5.26\repository\repository\datastore
>
> 12/11/2009  10:17    <DIR>          .
> 12/11/2009  10:17    <DIR>          ..
>               0 File(s)              0 bytes
>
>     Total Files Listed:
>               0 File(s)              0 bytes
>               2 Dir(s)  69,863,792,640 bytes free
>
>
> --
> View this message in context: http://n4.nabble.com/Garbage-Collection-not-deleting-until-restart-of-server-tp620143p620190.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>

Mime
View raw message