svn commit: r551086 - /jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
Author: imario Date: Wed Jun 27 00:43:53 2007 New Revision: 551086 URL: http://svn.apache.org/viewvc?view=revrev=551086 Log: fixed race condition Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?view=diffrev=551086r1=551085r2=551086 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Wed Jun 27 00:43:53 2007 @@ -36,7 +36,7 @@ * This implementation caches every file as long as it is strongly reachable by * the java vm. As soon as the vm needs memory - every softly reachable file * will be discarded. - * + * * @author a href=mailto:[EMAIL PROTECTED]Mario Ivankovits/a * @version $Revision$ $Date: 2005-09-30 09:02:41 +0200 (Fr, 30 Sep * 2005) $ @@ -81,8 +81,12 @@ continue; } - FileSystemAndNameKey key = (FileSystemAndNameKey) refReverseMap - .get(ref); + FileSystemAndNameKey key; + synchronized(refReverseMap) + { + key = (FileSystemAndNameKey) refReverseMap + .get(ref); + } if (key != null) { @@ -152,7 +156,10 @@ synchronized (files) { files.put(file.getName(), ref); - refReverseMap.put(ref, key); + synchronized(refReverseMap) + { + refReverseMap.put(ref, key); + } } } @@ -190,19 +197,21 @@ synchronized (files) { - Iterator iterKeys = refReverseMap.values().iterator(); - while (iterKeys.hasNext()) + synchronized(refReverseMap) { - FileSystemAndNameKey key = (FileSystemAndNameKey) iterKeys - .next(); - if (key.getFileSystem() == filesystem) + Iterator iterKeys = refReverseMap.values().iterator(); + while (iterKeys.hasNext()) { - iterKeys.remove(); - files.remove(key.getFileName()); + FileSystemAndNameKey key = (FileSystemAndNameKey) iterKeys.next(); + if (key.getFileSystem() == filesystem) + { + iterKeys.remove(); + files.remove(key.getFileName()); + } } - } - closeFilesystem = files.size() 1; + closeFilesystem = files.size() 1; + } } if (closeFilesystem) @@ -240,7 +249,11 @@ { filesystemCache.clear(); } - refReverseMap.clear(); + + synchronized(refReverseMap) + { + refReverseMap.clear(); + } } public void removeFile(FileSystem filesystem, FileName name) @@ -269,7 +282,10 @@ Object ref = files.remove(key.getFileName()); if (ref != null) { - refReverseMap.remove(ref); + synchronized(refReverseMap) + { + refReverseMap.remove(ref); + } } return files.size() 1; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (VFS-157) Cache the hashCode in AbstractFileName
Cache the hashCode in AbstractFileName -- Key: VFS-157 URL: https://issues.apache.org/jira/browse/VFS-157 Project: Commons VFS Issue Type: Improvement Reporter: Adam Heath See $summary and patch. Noticeable speedup. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (VFS-157) Cache the hashCode in AbstractFileName
[ https://issues.apache.org/jira/browse/VFS-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adam Heath updated VFS-157: --- Affects Version/s: 1.1 Cache the hashCode in AbstractFileName -- Key: VFS-157 URL: https://issues.apache.org/jira/browse/VFS-157 Project: Commons VFS Issue Type: Improvement Affects Versions: 1.1 Reporter: Adam Heath Attachments: feature_cache-AbstractFileName-hashCode.patch See $summary and patch. Noticeable speedup. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (VFS-157) Cache the hashCode in AbstractFileName
[ https://issues.apache.org/jira/browse/VFS-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adam Heath updated VFS-157: --- Attachment: feature_cache-AbstractFileName-hashCode.patch Against svn 501759. Cache the hashCode in AbstractFileName -- Key: VFS-157 URL: https://issues.apache.org/jira/browse/VFS-157 Project: Commons VFS Issue Type: Improvement Affects Versions: 1.1 Reporter: Adam Heath Attachments: feature_cache-AbstractFileName-hashCode.patch See $summary and patch. Noticeable speedup. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r537936 - in /jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs: cache/DefaultFilesCache.java cache/SoftRefFilesCache.java provider/AbstractFileName.java
Author: imario Date: Mon May 14 11:24:35 2007 New Revision: 537936 URL: http://svn.apache.org/viewvc?view=revrev=537936 Log: VFS-145 + VFS-157: Use HashMap for caches and cache calculated hashCode in FileName - Thanks to Adam Heath for the patch! Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java?view=diffrev=537936r1=537935r2=537936 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java Mon May 14 11:24:35 2007 @@ -22,7 +22,6 @@ import java.util.HashMap; import java.util.Map; -import java.util.TreeMap; /** * A [EMAIL PROTECTED] org.apache.commons.vfs.FilesCache} implementation.br @@ -58,7 +57,7 @@ Map files = (Map) filesystemCache.get(filesystem); if (files == null) { -files = new TreeMap(); +files = new HashMap(); filesystemCache.put(filesystem, files); } Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?view=diffrev=537936r1=537935r2=537936 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Mon May 14 11:24:35 2007 @@ -16,14 +16,6 @@ */ package org.apache.commons.vfs.cache; -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.SoftReference; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.vfs.FileName; @@ -33,6 +25,13 @@ import org.apache.commons.vfs.impl.DefaultFileSystemManager; import org.apache.commons.vfs.util.Messages; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.SoftReference; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + /** * This implementation caches every file as long as it is strongly reachable by * the java vm. As soon as the vm needs memory - every softly reachable file @@ -289,7 +288,7 @@ Map files = (Map) filesystemCache.get(filesystem); if (files == null) { - files = new TreeMap(); + files = new HashMap(); filesystemCache.put(filesystem, files); } Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java?view=diffrev=537936r1=537935r2=537936 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java Mon May 14 11:24:35 2007 @@ -29,479 +29,487 @@ * @version $Revision$ $Date$ */ public abstract class AbstractFileName -implements FileName + implements FileName { -private final String scheme; -private final String absPath; -private FileType type; - -// Cached stuff -private String uri; -private String baseName; -private String rootUri; -private String extension; -private String decodedAbsPath; - -public AbstractFileName(final String scheme, -final String absPath, FileType type) -{ -this.rootUri = null; -this.scheme = scheme; -this.type = type; -if (absPath != null absPath.length() 0) -{ -if (absPath.length() 1 absPath.endsWith(/)) -{ -this.absPath
[jira] Resolved: (VFS-157) Cache the hashCode in AbstractFileName
[ https://issues.apache.org/jira/browse/VFS-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mario Ivankovits resolved VFS-157. -- Resolution: Fixed Fix Version/s: 1.1 A - TFTP! ;-) Cache the hashCode in AbstractFileName -- Key: VFS-157 URL: https://issues.apache.org/jira/browse/VFS-157 Project: Commons VFS Issue Type: Improvement Affects Versions: 1.1 Reporter: Adam Heath Fix For: 1.1 Attachments: feature_cache-AbstractFileName-hashCode.patch See $summary and patch. Noticeable speedup. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Commented: (CONFIGURATION-180) Cache DatabaseConfiguration values for higher performance
[ https://issues.apache.org/jira/browse/CONFIGURATION-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491813 ] Emmanuel Bourg commented on CONFIGURATION-180: -- I see several solutions to improve the performances by caching the properties. We may either : 1. load the entire configuration in memory. A flush() method would save the new/modified properties back to the database, a sync() method would reload the properties. That may be nice to reuse the reloading strategies but currently they are specific to the file configurations, that will require some refactoring. 2. keep in memory the properties read for a certain time. getProperty(foo) will hit the database only if foo was read more than 5 minutes ago for example. The delay would be adjustable. Setting a property would still hit the database directly. 3. same as 2, but the configuration is preloaded once. The caching should be optional to preserve the current behavior if needed. Cache DatabaseConfiguration values for higher performance - Key: CONFIGURATION-180 URL: https://issues.apache.org/jira/browse/CONFIGURATION-180 Project: Commons Configuration Issue Type: Improvement Reporter: Stephen Cooper Assigned To: Emmanuel Bourg Priority: Minor Fix For: 1.5 Attachments: dbpreload.txt, Enhancement33553.checkstyle.patch, Enhancement33553.patch The DatabaseConfiguration class queries each property as it gets the request for each property. This is nice for ensuring that you're always up to date, but it doesn't give very good performance in enterprise applications, where the database may not be on the same subnet. What we need is the ability to hit the database once, get all the keys/values and then serve up getString etc. from that cache. I'll be opening a separate enhancement to have a generic Reloading Strategy which could then be applied to this caching DatabaseConfiguration approach. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Commented: (CONFIGURATION-180) Cache DatabaseConfiguration values for higher performance
[ https://issues.apache.org/jira/browse/CONFIGURATION-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488794 ] Emmanuel Bourg commented on CONFIGURATION-180: -- I modified DatabaseConfiguration to ensure the connection is always closed. Cache DatabaseConfiguration values for higher performance - Key: CONFIGURATION-180 URL: https://issues.apache.org/jira/browse/CONFIGURATION-180 Project: Commons Configuration Issue Type: Improvement Reporter: Stephen Cooper Priority: Minor Fix For: 1.5 Attachments: dbpreload.txt, Enhancement33553.checkstyle.patch, Enhancement33553.patch The DatabaseConfiguration class queries each property as it gets the request for each property. This is nice for ensuring that you're always up to date, but it doesn't give very good performance in enterprise applications, where the database may not be on the same subnet. What we need is the ability to hit the database once, get all the keys/values and then serve up getString etc. from that cache. I'll be opening a separate enhancement to have a generic Reloading Strategy which could then be applied to this caching DatabaseConfiguration approach. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (CONFIGURATION-180) Cache DatabaseConfiguration values for higher performance
[ https://issues.apache.org/jira/browse/CONFIGURATION-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Emmanuel Bourg updated CONFIGURATION-180: - Environment: (was: Operating System: All Platform: All) Summary: Cache DatabaseConfiguration values for higher performance (was: [configuration] Cache DatabaseConfiguration values for higher performance) Cache DatabaseConfiguration values for higher performance - Key: CONFIGURATION-180 URL: https://issues.apache.org/jira/browse/CONFIGURATION-180 Project: Commons Configuration Issue Type: Improvement Reporter: Stephen Cooper Priority: Minor Fix For: 1.5 Attachments: dbpreload.txt, Enhancement33553.checkstyle.patch, Enhancement33553.patch The DatabaseConfiguration class queries each property as it gets the request for each property. This is nice for ensuring that you're always up to date, but it doesn't give very good performance in enterprise applications, where the database may not be on the same subnet. What we need is the ability to hit the database once, get all the keys/values and then serve up getString etc. from that cache. I'll be opening a separate enhancement to have a generic Reloading Strategy which could then be applied to this caching DatabaseConfiguration approach. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Resolved: (VFS-114) FtpFileObject lists children excessively using ON_RESOLVE cache strategy
[ https://issues.apache.org/jira/browse/VFS-114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mario Ivankovits resolved VFS-114. -- Resolution: Fixed Fix Version/s: 1.1 Good catch. Applied. Thanks! Ciao, Mario FtpFileObject lists children excessively using ON_RESOLVE cache strategy Key: VFS-114 URL: https://issues.apache.org/jira/browse/VFS-114 Project: Commons VFS Issue Type: Bug Affects Versions: 1.1 Environment: Mac OS X 10.4.8, Darwin 8.8.0; Java 1.5.0_06; Libraries: ant-1.6.2.jar, commons-net-1.4.1.jar, commons-logging-1.0.4.jar, commons-collections-3.1.jar, jcifs-0.8.3.jar, jakarta-slide-webdavlib-20050629.161100.jar, jdom-1.0.jar, commons-httpclient-2.0.2.jar, jsch-0.1.23.jar, xml-apis-1.0.b2.jar, oro-2.0.8.jar, maven-xdoc-plugin-1.9.2.jar, Reporter: K. Lo Shih Priority: Minor Fix For: 1.1 Attachments: VFS-114.patch When calling FileObject.getChildren() on a org.apache.commons.vfs.provider.ftp.FtpFileObject using the default ON_RESOLVE cache strategy, I would FtpClientWrapper.listFiles() to be called only once. Instead, because FileObject.refresh() is called once for itself and each of its parents for each of the children. For example, if there's a file structure like: pre ftp://ftp.example.com A/ B/ C/ 1 2 3 /pre and you list files for the URL ftp://ftp.example.com/A/B/C/;. Instead of calling listFiles() once on C, it calls listFiles() on each of A, B, and C for each of the children 1, 2 and 3, i.e. 9 times. I discovered this when listing a directory with 709 files--you can imagine my bewilderment at how long it took. I fixed this by reusing the FtpFileObject.inRefresh flag within AbstractFileObject.getChildren() to not refresh the listed directory when its children request a refresh. I've used this inRefresh incorrectly, I think. I should rather use a separate flag depth counter like FtpFileObject.refreshDepth, incremented upon entry into AbstractFileObject.getChildren() and decremented upon exit. This approach would fix the implementation for providers other than FTP as well. Anyways, here's my patch: Index: core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java === --- core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java (revision 513805) +++ core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java (working copy) @@ -94,7 +94,12 @@ */ private FTPFile getChildFile(final String name, final boolean flush) throws IOException { -if (flush) +/* If we should flush cached children, clear our children map unless + * we're in the middle of a refresh in which case we've just recently + * refreshed our children. No need to do it again when our children are + * refresh()ed, calling getChildFile() for themselves from within + * getInfo(). See getChildren(). */ +if (flush !inRefresh) { children = null; } @@ -322,6 +327,28 @@ return null; } + +/** Returns the file's list of children. + * + * @return The list of children + * @throws FileSystemException If there was a problem listing children + * @seeAbstratFileObject#getChildren() + * @since 1.0 + */ +public FileObject[] getChildren() throws FileSystemException { +try { +/* Wrap our parent implementation, noting that we're refreshing so + * that we don't refresh() ourselves and each of our parents for + * each children. Note that refresh() will list children. Meaning, + * if if this file has C children, P parents, there will be (C * P) + * listings made with (C * (P + 1)) refreshes, when there should + * really only be 1 listing and C refreshes. */ +this.inRefresh = true; +return super.getChildren(); +} finally { +this.inRefresh = false; +} +} /** * Lists the children of the file. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (VFS-114) FtpFileObject lists children excessively using ON_RESOLVE cache strategy
FtpFileObject lists children excessively using ON_RESOLVE cache strategy Key: VFS-114 URL: https://issues.apache.org/jira/browse/VFS-114 Project: Commons VFS Issue Type: Bug Affects Versions: 1.1 Environment: Mac OS X 10.4.8, Darwin 8.8.0; Java 1.5.0_06; Libraries: ant-1.6.2.jar, commons-net-1.4.1.jar, commons-logging-1.0.4.jar, commons-collections-3.1.jar, jcifs-0.8.3.jar, jakarta-slide-webdavlib-20050629.161100.jar, jdom-1.0.jar, commons-httpclient-2.0.2.jar, jsch-0.1.23.jar, xml-apis-1.0.b2.jar, oro-2.0.8.jar, maven-xdoc-plugin-1.9.2.jar, Reporter: K. Lo Shih Priority: Minor When calling FileObject.getChildren() on a org.apache.commons.vfs.provider.ftp.FtpFileObject using the default ON_RESOLVE cache strategy, I would FtpClientWrapper.listFiles() to be called only once. Instead, because FileObject.refresh() is called once for itself and each of its parents for each of the children. For example, if there's a file structure like: pre ftp://ftp.example.com A/ B/ C/ 1 2 3 /pre and you list files for the URL ftp://ftp.example.com/A/B/C/;. Instead of calling listFiles() once on C, it calls listFiles() on each of A, B, and C for each of the children 1, 2 and 3, i.e. 9 times. I discovered this when listing a directory with 709 files--you can imagine my bewilderment at how long it took. I fixed this by reusing the FtpFileObject.inRefresh flag within AbstractFileObject.getChildren() to not refresh the listed directory when its children request a refresh. I've used this inRefresh incorrectly, I think. I should rather use a separate flag depth counter like FtpFileObject.refreshDepth, incremented upon entry into AbstractFileObject.getChildren() and decremented upon exit. This approach would fix the implementation for providers other than FTP as well. Anyways, here's my patch: Index: core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java === --- core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java (revision 513805) +++ core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java (working copy) @@ -94,7 +94,12 @@ */ private FTPFile getChildFile(final String name, final boolean flush) throws IOException { -if (flush) +/* If we should flush cached children, clear our children map unless + * we're in the middle of a refresh in which case we've just recently + * refreshed our children. No need to do it again when our children are + * refresh()ed, calling getChildFile() for themselves from within + * getInfo(). See getChildren(). */ +if (flush !inRefresh) { children = null; } @@ -322,6 +327,28 @@ return null; } + +/** Returns the file's list of children. + * + * @return The list of children + * @throws FileSystemException If there was a problem listing children + * @seeAbstratFileObject#getChildren() + * @since 1.0 + */ +public FileObject[] getChildren() throws FileSystemException { +try { +/* Wrap our parent implementation, noting that we're refreshing so + * that we don't refresh() ourselves and each of our parents for + * each children. Note that refresh() will list children. Meaning, + * if if this file has C children, P parents, there will be (C * P) + * listings made with (C * (P + 1)) refreshes, when there should + * really only be 1 listing and C refreshes. */ +this.inRefresh = true; +return super.getChildren(); +} finally { +this.inRefresh = false; +} +} /** * Lists the children of the file. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (VFS-114) FtpFileObject lists children excessively using ON_RESOLVE cache strategy
[ https://issues.apache.org/jira/browse/VFS-114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] K. Lo Shih updated VFS-114: --- Attachment: VFS-114.patch I guess I need to separate patch file. FtpFileObject lists children excessively using ON_RESOLVE cache strategy Key: VFS-114 URL: https://issues.apache.org/jira/browse/VFS-114 Project: Commons VFS Issue Type: Bug Affects Versions: 1.1 Environment: Mac OS X 10.4.8, Darwin 8.8.0; Java 1.5.0_06; Libraries: ant-1.6.2.jar, commons-net-1.4.1.jar, commons-logging-1.0.4.jar, commons-collections-3.1.jar, jcifs-0.8.3.jar, jakarta-slide-webdavlib-20050629.161100.jar, jdom-1.0.jar, commons-httpclient-2.0.2.jar, jsch-0.1.23.jar, xml-apis-1.0.b2.jar, oro-2.0.8.jar, maven-xdoc-plugin-1.9.2.jar, Reporter: K. Lo Shih Priority: Minor Attachments: VFS-114.patch When calling FileObject.getChildren() on a org.apache.commons.vfs.provider.ftp.FtpFileObject using the default ON_RESOLVE cache strategy, I would FtpClientWrapper.listFiles() to be called only once. Instead, because FileObject.refresh() is called once for itself and each of its parents for each of the children. For example, if there's a file structure like: pre ftp://ftp.example.com A/ B/ C/ 1 2 3 /pre and you list files for the URL ftp://ftp.example.com/A/B/C/;. Instead of calling listFiles() once on C, it calls listFiles() on each of A, B, and C for each of the children 1, 2 and 3, i.e. 9 times. I discovered this when listing a directory with 709 files--you can imagine my bewilderment at how long it took. I fixed this by reusing the FtpFileObject.inRefresh flag within AbstractFileObject.getChildren() to not refresh the listed directory when its children request a refresh. I've used this inRefresh incorrectly, I think. I should rather use a separate flag depth counter like FtpFileObject.refreshDepth, incremented upon entry into AbstractFileObject.getChildren() and decremented upon exit. This approach would fix the implementation for providers other than FTP as well. Anyways, here's my patch: Index: core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java === --- core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java (revision 513805) +++ core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java (working copy) @@ -94,7 +94,12 @@ */ private FTPFile getChildFile(final String name, final boolean flush) throws IOException { -if (flush) +/* If we should flush cached children, clear our children map unless + * we're in the middle of a refresh in which case we've just recently + * refreshed our children. No need to do it again when our children are + * refresh()ed, calling getChildFile() for themselves from within + * getInfo(). See getChildren(). */ +if (flush !inRefresh) { children = null; } @@ -322,6 +327,28 @@ return null; } + +/** Returns the file's list of children. + * + * @return The list of children + * @throws FileSystemException If there was a problem listing children + * @seeAbstratFileObject#getChildren() + * @since 1.0 + */ +public FileObject[] getChildren() throws FileSystemException { +try { +/* Wrap our parent implementation, noting that we're refreshing so + * that we don't refresh() ourselves and each of our parents for + * each children. Note that refresh() will list children. Meaning, + * if if this file has C children, P parents, there will be (C * P) + * listings made with (C * (P + 1)) refreshes, when there should + * really only be 1 listing and C refreshes. */ +this.inRefresh = true; +return super.getChildren(); +} finally { +this.inRefresh = false; +} +} /** * Lists the children of the file. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r484648 - in /jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs: ./ cache/ impl/ provider/ provider/tar/ provider/zip/
Author: imario Date: Fri Dec 8 08:18:36 2006 New Revision: 484648 URL: http://svn.apache.org/viewvc?view=revrev=484648 Log: Again changed when and how to release resources. Now we count the number of still accessible fileObject. If, for some reason this do not work there now is also the FileSystemManager.closeFileSystem(FileSystem) method where you can explicitely close the fileSystem and free all its resources (including the cache). This method might be dangerous if you use VFS as singleton (VFS.getManager()) and call it on a global fileSystem. This closes the filesystem for all other thread too. Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystem.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileObject.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileSystem.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/tar/TarFileSystem.java jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystem.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystem.java?view=diffrev=484648r1=484647r2=484648 == (empty) Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java?view=diffrev=484648r1=484647r2=484648 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java Fri Dec 8 08:18:36 2006 @@ -177,7 +177,13 @@ public FileObject createFileSystem(String provider, FileObject file) throws FileSystemException; -/** + /** +* Closes the given filesystem.br / +* If you use VFS as singleton it is VERY dangerous to call this method. +*/ + public void closeFileSystem(FileSystem filesystem); + + /** * Creates a layered file system. A layered file system is a file system * that is created from the contents of a file, such as a zip or tar file. * Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?view=diffrev=484648r1=484647r2=484648 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Fri Dec 8 08:18:36 2006 @@ -227,7 +227,7 @@ } } ((DefaultFileSystemManager) getContext().getFileSystemManager()) - .closeFileSystem(filesystem); + ._closeFileSystem(filesystem); } public void close() Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java?view=diffrev=484648r1=484647r2=484648 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java Fri Dec 8 08:18:36 2006 @@ -915,7 +915,24 @@ return new VfsStreamHandlerFactory(); } + /** +* Closes the given filesystem.br / +* If you use VFS as singleton it is VERY dangerous to call this method +*/ public void closeFileSystem(FileSystem filesystem) + { + // inform the cache ... + getFilesCache().clear(filesystem
[jira] Updated: (VFS-49) [VFS] Default VFS cache behavior
[ http://issues.apache.org/jira/browse/VFS-49?page=all ] Mario Ivankovits updated VFS-49: Bugzilla Id: (was: 38686) Fix Version/s: later [VFS] Default VFS cache behavior Key: VFS-49 URL: http://issues.apache.org/jira/browse/VFS-49 Project: Commons VFS Issue Type: Improvement Affects Versions: Nightly Builds Environment: Operating System: All Platform: All Reporter: Jean-Baptiste Onofré Priority: Minor Fix For: later It's really a bug but a explanation. The default VFS cache is SoftRefFilesCache. In my process, I have a FileManipulator which is simply a singleton. This singleton create one (and only one max) instance of FileSystemManager using VFS.getManager(). This process is called every 10mn to perform a copy from a FileObject to another. In earch loop, I perform something which looks like : FIleManipulator fileManipulator = FileManipulator.getInstance(); fileManipulator.copy(tgz:http://remote/archive.tar.gz!/dir/file;, /tmp/file); Either the tgz:http://remote/archive.tar.gz!/dir/file has not change, in the vfs_cache directory, I have : tmp_19071_file tmp_19076_file So a copy if performed every loop and neither release which take a lot of space on the filesystem. How can I avoid this behavior ? Should I create a FileManipulator (and so a FileSystemManager) and use the same in the loop ? Do I need to define my own filesystemmanager with another FileCache system (such as NullFileCache) ? Is it possible to define another VFS cache system for the default filesystem manager got with VFS.getManager() ? Many thanks for your help. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r476349 - in /jakarta/commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs/cache/ sandbox/src/main/java/org/apache/commons/vfs/provider/mime/ sandbox/src/main/java/org/apach
Author: imario Date: Fri Nov 17 14:52:44 2006 New Revision: 476349 URL: http://svn.apache.org/viewvc?view=revrev=476349 Log: added WeakRefFilesCache which should be a little bit faster in freeing resources, though, not sure about it yet. optimized freeing resources int SharedRandomContentInputStream Added: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java (with props) Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/SharedRandomContentInputStream.java Modified: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?view=diffrev=476349r1=476348r2=476349 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Fri Nov 17 14:52:44 2006 @@ -145,7 +145,7 @@ Map files = getOrCreateFilesystemCache(file.getFileSystem()); - Reference ref = new SoftReference(file, refqueue); + Reference ref = createReference(file, refqueue); FileSystemAndNameKey key = new FileSystemAndNameKey(file .getFileSystem(), file.getName()); @@ -156,13 +156,18 @@ } } + protected Reference createReference(FileObject file, ReferenceQueue refqueue) + { + return new SoftReference(file, refqueue); + } + public FileObject getFile(final FileSystem filesystem, final FileName name) { Map files = getOrCreateFilesystemCache(filesystem); synchronized (files) { - SoftReference ref = (SoftReference) files.get(name); + Reference ref = (Reference) files.get(name); if (ref == null) { return null; Added: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java?view=autorev=476349 == --- jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java (added) +++ jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java Fri Nov 17 14:52:44 2006 @@ -0,0 +1,26 @@ +package org.apache.commons.vfs.cache; + +import org.apache.commons.vfs.FileObject; + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; + +/** + * This implementation caches every file as long as it is strongly reachable by + * the java vm. As soon as the object is no longer reachable it will be discarded. + * In contrast to the SoftRefFilesCache this implementation might free resources faster + * as it don't wait until a memory limitation. + * + * @author a href=mailto:[EMAIL PROTECTED]Mario Ivankovits/a + * @version $Revision$ $Date: 2005-09-30 09:02:41 +0200 (Fr, 30 Sep + * 2005) $ + * @see java.lang.ref.WeakReference + */ +public class WeakRefFilesCache extends SoftRefFilesCache +{ + protected Reference createReference(FileObject file, ReferenceQueue refqueue) + { + return new WeakReference(file, refqueue); + } +} Propchange: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java -- svn:eol-style = native Propchange: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: jakarta/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java -- svn:mime-type = text/plain Modified: jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider
[jira] Commented: (EL-5) [el] Contention on global cache / parseExpression
[ http://issues.apache.org/jira/browse/EL-5?page=comments#action_12443708 ] Ravishankar S commented on EL-5: Confirmed Matthias's observation at high concurrencies. We didn't see anything at lower concurrent access. We have a page that uses a lot of EL tags and expressions and this bug killed our tomcat and we had to keep restarting tomcat every 15 minutes before it started all over again Somebody needs to take a good, hard, long look at this. [el] Contention on global cache / parseExpression - Key: EL-5 URL: http://issues.apache.org/jira/browse/EL-5 Project: Commons EL Issue Type: Bug Affects Versions: 1.0 Final Environment: Operating System: other Platform: Other Reporter: Matthias Ernst Attachments: patch, patch-el-cache.txt The ExpresssionEvaluatorImpl maintains a static synchronized hashmap as a global parser cache. In my tests, this proves to be a contention point in highly concurrent web access, even if the cache is already filled: tcpConnection-8080-514 daemon prio=1 tid=0x08214890 nid=0x4e39 waiting for monitor entry [bd9ff000..bd9ff908] at java.util.Collections$SynchronizedMap.get(Collections.java:1942) - waiting to lock 0x45586ef0 (a java.util.Collections$SynchronizedMap) at org.apache.commons.el.ExpressionEvaluatorImpl.parseExpressionString(ExpressionEvaluatorImpl.java:306) ... Even pre-parsing the expressions through #parseExpression doesn't help: it parses the expression for syntactic correctness and returns an instance of JSTLExpression that, however, doesn't contain the parsing result. It is reparsed on every evaluation. I propose * evaluator instance local caches that still need synchronization, but can be made thread-local, page-local oder whatever by the calling application / container. * to actually maintain the parsing result in JstlExpression I would volunteer to develop the respective patches, if desired. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Commented: (EL-5) [el] Contention on global cache / parseExpression
[ http://issues.apache.org/jira/browse/EL-5?page=comments#action_12443730 ] Matthias Ernst commented on EL-5: - Ravishankar, high contention on the monitor only makes things run slower. It is not a deadlock and it should not kill your Tomcat. It might get overloaded more easily. Jacob Hookom told me work was underway to keep EL parse trees in compiled JSPs in Jasper (Tomcat 6?). For 5.5 the problem still stands and I do not understand why noone would even bother commenting on my really simple patch. All it does is replace: expr = synchronizedMap.get(s); if(expr == null) { expr = parse(s); synchronizedMap.put(s, expr); } by synchronized(lock) { localMap = cache; } expr = localMap.get(s); if(expr == null) { expr = parse(s); synchronized(lock) { // optional: refetch cache in case someone updated it while we parsed localMap = cache; } localMap = copy(localMap); localMap.put(s, expr); synchronized(lock) { cache = localMap; } } For a cache miss it has three instead of two synchronized, but once the cache is filled, there's only one very short synchronized to read the cache field. [el] Contention on global cache / parseExpression - Key: EL-5 URL: http://issues.apache.org/jira/browse/EL-5 Project: Commons EL Issue Type: Bug Affects Versions: 1.0 Final Environment: Operating System: other Platform: Other Reporter: Matthias Ernst Attachments: patch, patch-el-cache.txt The ExpresssionEvaluatorImpl maintains a static synchronized hashmap as a global parser cache. In my tests, this proves to be a contention point in highly concurrent web access, even if the cache is already filled: tcpConnection-8080-514 daemon prio=1 tid=0x08214890 nid=0x4e39 waiting for monitor entry [bd9ff000..bd9ff908] at java.util.Collections$SynchronizedMap.get(Collections.java:1942) - waiting to lock 0x45586ef0 (a java.util.Collections$SynchronizedMap) at org.apache.commons.el.ExpressionEvaluatorImpl.parseExpressionString(ExpressionEvaluatorImpl.java:306) ... Even pre-parsing the expressions through #parseExpression doesn't help: it parses the expression for syntactic correctness and returns an instance of JSTLExpression that, however, doesn't contain the parsing result. It is reparsed on every evaluation. I propose * evaluator instance local caches that still need synchronization, but can be made thread-local, page-local oder whatever by the calling application / container. * to actually maintain the parsing result in JstlExpression I would volunteer to develop the respective patches, if desired. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (EL-5) [el] Contention on global cache / parseExpression
[ http://issues.apache.org/jira/browse/EL-5?page=all ] Matthias Ernst updated EL-5: Attachment: patch-el-cache.txt I have stumbled over this again. The synchronized map proves to be a point of contention in an application that runs on a highly concurrent machine (Sun T2000 w/32 cores) with JSPs that contain many EL expressions. Several hundred hits/s times several ten expressions/JSP leads to several (ten) thousand ELuations per second. The simplest patch that could possibly work is as follows: instead of using a mutable, synchronized hashmap, use an immutable, copy-on write table where only the access to the cache field itself is protected through a monitor. A corresponding patch is attached. [With Java 5, this monitor-protected field could even be replaced through a volatile field. Doing so is legal under the revised memory model and produced even more throughput in my non-trivial testcase.] [el] Contention on global cache / parseExpression - Key: EL-5 URL: http://issues.apache.org/jira/browse/EL-5 Project: Commons EL Type: Bug Versions: 1.0 Final Environment: Operating System: other Platform: Other Reporter: Matthias Ernst Attachments: patch, patch-el-cache.txt The ExpresssionEvaluatorImpl maintains a static synchronized hashmap as a global parser cache. In my tests, this proves to be a contention point in highly concurrent web access, even if the cache is already filled: tcpConnection-8080-514 daemon prio=1 tid=0x08214890 nid=0x4e39 waiting for monitor entry [bd9ff000..bd9ff908] at java.util.Collections$SynchronizedMap.get(Collections.java:1942) - waiting to lock 0x45586ef0 (a java.util.Collections$SynchronizedMap) at org.apache.commons.el.ExpressionEvaluatorImpl.parseExpressionString(ExpressionEvaluatorImpl.java:306) ... Even pre-parsing the expressions through #parseExpression doesn't help: it parses the expression for syntactic correctness and returns an instance of JSTLExpression that, however, doesn't contain the parsing result. It is reparsed on every evaluation. I propose * evaluator instance local caches that still need synchronization, but can be made thread-local, page-local oder whatever by the calling application / container. * to actually maintain the parsing result in JstlExpression I would volunteer to develop the respective patches, if desired. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuration Cache
Marcus Malcom a écrit : My use case is to make sure that a configuration file is only loaded once per class loader space. I didn't see anything in the configuration API that accomplishes this (please let me know if I missed something). The call would look something like this: cache.getConfiguration(someFile) Naturally, this can be done with any Configuration, but I'm looking mainly at the file configurations at the moment. The API would look something like this: Configuration getConfiguration(String fileName) Configuration getConfiguration(URL url) Configuration getConfiguration(File file) Again, the point is that the cache object (singleton/multiton) would cache the configuration file so that subsequent calls to getConfiguration(...) would return the same object. I do have some example code that I put together yesterday, should I send them to the group? I had a similar need on a project, I wrote a ConfigurationManager class caching the configurations and performing an application specific lookup to locate the configuration file. I'm not sure if such a singleton should be introduced in the API though, such a caching looks a bit out of scope to me. Developers will adopt very different approaches to this issue depending on their architecture or personal taste (singleton, dependency injection, existing cache API...) We can't really impose one way of doing it. However this might be a good addition to our Wiki. We already have a Spring example there. http://wiki.apache.org/jakarta-commons/Configuration Emmanuel Bourg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Configuration Cache
Hi Marcus, Marcus Malcom wrote on Wednesday, April 05, 2006 6:17 PM: Commons Project: Configuration I was thinking about creating a Configuration Cache. Essentially this would would be very specific to a PropertiesConfiguration at the start and would move to be more generic as needed. The cache would be a centralized location to obtain instances of PropertiesConfiguration - standardizing a singleton/multiton approach. My first question is: Does anyone know if there's something out there already that does this? (did I just miss something) Second: If there isn't anything out there, would the commons group be interested in a code submit on this? I am not sure, that I really understand what you're up to. Can you give a use case? - Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Configuration Cache
Hi Jörg, See comments below. Thanks, -- Marcus On Thu, 2006-04-06 at 09:45 +0200, Jörg Schaible wrote: Hi Marcus, Marcus Malcom wrote on Wednesday, April 05, 2006 6:17 PM: Commons Project: Configuration I was thinking about creating a Configuration Cache. Essentially this would would be very specific to a PropertiesConfiguration at the start and would move to be more generic as needed. The cache would be a centralized location to obtain instances of PropertiesConfiguration - standardizing a singleton/multiton approach. My first question is: Does anyone know if there's something out there already that does this? (did I just miss something) Second: If there isn't anything out there, would the commons group be interested in a code submit on this? I am not sure, that I really understand what you're up to. Can you give a use case? My use case is to make sure that a configuration file is only loaded once per class loader space. I didn't see anything in the configuration API that accomplishes this (please let me know if I missed something). The call would look something like this: cache.getConfiguration(someFile) Naturally, this can be done with any Configuration, but I'm looking mainly at the file configurations at the moment. The API would look something like this: Configuration getConfiguration(String fileName) Configuration getConfiguration(URL url) Configuration getConfiguration(File file) Again, the point is that the cache object (singleton/multiton) would cache the configuration file so that subsequent calls to getConfiguration(...) would return the same object. I do have some example code that I put together yesterday, should I send them to the group? Thanks! - Jörg signature.asc Description: This is a digitally signed message part
Configuration Cache
Commons Project: Configuration I was thinking about creating a Configuration Cache. Essentially this would would be very specific to a PropertiesConfiguration at the start and would move to be more generic as needed. The cache would be a centralized location to obtain instances of PropertiesConfiguration - standardizing a singleton/multiton approach. My first question is: Does anyone know if there's something out there already that does this? (did I just miss something) Second: If there isn't anything out there, would the commons group be interested in a code submit on this? Thanks! -- Marcus Malcom OCHIN Software Engineer [EMAIL PROTECTED] signature.asc Description: This is a digitally signed message part
svn commit: r390219 - in /jakarta/commons/proper/vfs/trunk/src: java/org/apache/commons/vfs/ java/org/apache/commons/vfs/cache/ java/org/apache/commons/vfs/impl/ java/org/apache/commons/vfs/provider/
Author: imario Date: Thu Mar 30 11:16:24 2006 New Revision: 390219 URL: http://svn.apache.org/viewcvs?rev=390219view=rev Log: added cacheStrategy to fileSystemManager Added: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java (with props) jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/OnCallRefreshFileObject.java (with props) jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/impl/DecoratedFileObject.java (with props) jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/FileObjectUtils.java (with props) jakarta/commons/proper/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderCacheStrategyTests.java (with props) Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileObject.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileSystemManager.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/Resources.properties jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/LRUFilesCache.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java jakarta/commons/proper/vfs/trunk/src/test/org/apache/commons/vfs/test/AbstractProviderTestCase.java jakarta/commons/proper/vfs/trunk/src/test/org/apache/commons/vfs/test/AbstractTestSuite.java jakarta/commons/proper/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderTestSuite.java Added: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java?rev=390219view=auto == --- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java (added) +++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java Thu Mar 30 11:16:24 2006 @@ -0,0 +1,64 @@ +/* + * Copyright 2002-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.vfs; + +/** + * An enumerated type to deal with the various cache strategies. + * + * @author a href=mailto:[EMAIL PROTECTED]Mario Ivankovits/a + * @version $Revision$ $Date$ + */ +public final class CacheStrategy +{ +/** + * Deal with cached data manually. Call [EMAIL PROTECTED] FileObject#refresh()} to refresh the object data. + */ +public static final CacheStrategy MANUAL = new CacheStrategy(manual); + +/** + * Refresh the data every time you request a file from [EMAIL PROTECTED] FileSystemManager#resolveFile} + */ +public static final CacheStrategy ON_RESOLVE = new CacheStrategy(onresolve); + +/** + * Refresh the data every time you call a method on the fileObject. + * You'll use this only if you really need the latest info as this setting is a major performance loss. + */ +public static final CacheStrategy ON_CALL = new CacheStrategy(oncall); + +private final String name; + +private CacheStrategy(final String name) +{ +this.name = name; +} + +/** + * Returns the name of the scope. + */ +public String toString() +{ +return name; +} + +/** + * Returns the name of the scope. + */ +public String getName() +{ +return name; +} +} Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java -- svn:eol-style = native Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/CacheStrategy.java -- svn:mime-type = text/plain Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileObject.java URL: http://svn.apache.org
DO NOT REPLY [Bug 38686] - [VFS] Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2006-02-27 14:35 --- It seems to work. Thanks a lot for this workaround !!! -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38686] - [VFS] Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | --- Additional Comments From [EMAIL PROTECTED] 2006-02-27 17:33 --- Ok, so lets see if we can add this replicator to VFS ;-) -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38686] - [VFS] Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 --- Additional Comments From [EMAIL PROTECTED] 2006-02-21 10:29 --- Hi, the tmp files are created by the FileReplicator and are deleted during shutdown of the VFS-Manager. You may set your own implementation of a FileReplicator (that does a better Job) via: ((DefaultFileSystemManager) VFS.getManager()).setReplicator(...); You may gracefully shutdown the default replicator (VFS.getManager()).getReplicator()) before. Be sure to do this at application start up!!! After accessing your tar.gz you should shutdown the implicitly created file system like so: ((DefaultFileSystemManager) VFS.getManger()).closeFileSystem(someFileObjectInYourTarGz.getFilesSystem()); This will release the TarFileSystem instance that holds the reference to the tmp File object. As far as I know there´s no event (or something like that) to keep track on file system shutdowns. So you may use a weak reference to the file object (you replicated) to cleanup the unused temp file: 1. create a class that extends java.lang.ref.WeakReference: public class WeakFileRef extends WeakReference { private String absPath; public WeakFileRef(File file, ReferenceQueue queue) { super(file, queue); this.absPath = file.getAbsolutePath(); } public String getPath() { return this.absPath; } } 2. Do your own FileReplicator implementation. You may copy and slightly modify org.apache.commons.vfs.impl.DefaultFileReplicator. Attention: don´t use any hard reference on file objects here - use the WeakFileRef class. 3. In your FileReplicator implementation create a field of type ReferenceQueue private ReferenceQueue queue = new ReferenceQueue(); 4. Change allocateFile(String): public File allocateFile(final String baseName) throws FileSystemException { WeakFileRef fileRef = (WeakFileRef) queue.poll(); // poll the refence queue and delete finalized files while (fileRef != null) { File toDelete = new File(fileRef.getAbsPath()); try { if (toDelete.exists()) { toDelete.delete(); } } catch (IOException) { // do some exception handling or throw a FileSystemExeption } copies.remove(fileRef); fileRef = (WeakFileRef) queue.poll(); } // Create a unique-ish file name final String basename = createFilename(baseName); filecount++; final File file = createFile(tempDir, basename); // Keep track to delete later copies.add(new WeakFileRef(file, queue)); // - changed return file; } 5. Change the close() method - ArrayList 'copies' now holds WeakFileRef objects! Notice that the files are not cleaned up immediately - it depends on garbage collection. Hope this helps/(works) ;-) -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38686] - [VFS] Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 --- Additional Comments From [EMAIL PROTECTED] 2006-02-21 11:43 --- Thanks a lot, I'm going to try it -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38686] - [VFS] Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 --- Additional Comments From [EMAIL PROTECTED] 2006-02-21 07:19 --- Any news about this ? Many thanks -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38686] New: - Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 Summary: Default VFS cache behavior Product: Commons Version: Nightly Builds Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P3 Component: VFS AssignedTo: commons-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] It's really a bug but a explanation. The default VFS cache is SoftRefFilesCache. In my process, I have a FileManipulator which is simply a singleton. This singleton create one (and only one max) instance of FileSystemManager using VFS.getManager(). This process is called every 10mn to perform a copy from a FileObject to another. In earch loop, I perform something which looks like : FIleManipulator fileManipulator = FileManipulator.getInstance(); fileManipulator.copy(tgz:http://remote/archive.tar.gz!/dir/file;, /tmp/file); Either the tgz:http://remote/archive.tar.gz!/dir/file has not change, in the vfs_cache directory, I have : tmp_19071_file tmp_19076_file So a copy if performed every loop and neither release which take a lot of space on the filesystem. How can I avoid this behavior ? Should I create a FileManipulator (and so a FileSystemManager) and use the same in the loop ? Do I need to define my own filesystemmanager with another FileCache system (such as NullFileCache) ? Is it possible to define another VFS cache system for the default filesystem manager got with VFS.getManager() ? Many thanks for your help. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38686] - [vfs] Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 [EMAIL PROTECTED] changed: What|Removed |Added Summary|Default VFS cache behavior |[vfs] Default VFS cache ||behavior -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38686] - [VFS] Default VFS cache behavior
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38686. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38686 [EMAIL PROTECTED] changed: What|Removed |Added Summary|[vfs] Default VFS cache |[VFS] Default VFS cache |behavior|behavior --- Additional Comments From [EMAIL PROTECTED] 2006-02-17 06:30 --- Sorry, I was tired yesterday evening (in France) when I have wrote the message. I correct some typing mistakes : Sentence 1 : It's NOT really a bug but an explanation Sentence 7 : In EACH loop, I perform something like that : Sentence 16 : So a copy IS performed every loop and neither deleted which take a lot of space on the filesystem. Sorry, thanks a lot -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 [EMAIL PROTECTED] changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2006-01-18 05:42 --- I don't think we're going to get any better than the current code on this issue. Brian's WeakHashtable fixes some cases transparently which is nice. A custom ServletContextListener class that calls release() can definitely solve the problem in all cases, but requires some additional work on the user's side. This class is currently in the release, but may end up just as documentation instead; issue still being debated. I'm therefore closing this. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37249] - [resources] Objects to be prevented from removal from JCS Cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37249. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37249 --- Additional Comments From [EMAIL PROTECTED] 2005-11-23 01:47 --- Yes JCS is Java Caching System. (In reply to comment #0) I am using JCS for caching some of my objects on the data layer side of my application. However,i want to have a functionality/callback from where I can prevent my object(s) from being removed fron the cache,even if they have reached their expiry time. This is required in cases where i have taken out an object from cahe for some processing but before i can finish my processing (which may take time),the object theoretically completes it's TTL (time to live)OR the cache reached it's upper limit on no. of objects.Is there any way where I can prevent my objects from being removed from the cache without giving infinite life to them. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37249] - [resources] Objects to be prevented from removal from JCS Cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37249. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37249 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Additional Comments From [EMAIL PROTECTED] 2005-11-23 02:07 --- Thanks for responding - you need to file this against in JCS issue tracking system then: http://jakarta.apache.org/jcs/issue-tracking.html Closing as INVALID. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r345668 - in /jakarta/commons/sandbox/proxy/trunk/src: java/org/apache/commons/proxy/provider/ test/org/apache/commons/proxy/provider/ test/org/apache/commons/proxy/provider/cache/
Author: jcarman Date: Sat Nov 19 10:47:10 2005 New Revision: 345668 URL: http://svn.apache.org/viewcvs?rev=345668view=rev Log: CachedProvider now supports a CacheEvictionListener. Added: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/cache/AbstractCacheTestCase.java (with props) jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/cache/TestSimpleCache.java (with props) jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/cache/TestThreadLocalCache.java (with props) Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestCachedProvider.java Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java?rev=345668r1=345667r2=345668view=diff == --- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java (original) +++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java Sat Nov 19 10:47:10 2005 @@ -18,10 +18,11 @@ import org.apache.commons.proxy.ObjectProvider; import org.apache.commons.proxy.provider.cache.Cache; +import org.apache.commons.proxy.provider.cache.CacheEvictionListener; /** * Uses a [EMAIL PROTECTED] Cache} to store its target object which is provided by an codeinner/code object provider. - * + * * @author James Carman * @version 1.0 */ @@ -31,8 +32,8 @@ //-- // Fields //-- - private final Object cacheKey = new Object(); +private CacheEvictionListener evictionListener; private Cache cache; //-- @@ -54,7 +55,14 @@ if( object == null ) { object = super.getObject(); -cache.storeObject( cacheKey, object ); +if( evictionListener == null ) +{ +cache.storeObject( cacheKey, object ); +} +else +{ +cache.storeObject( cacheKey, object, evictionListener ); +} } return object; } @@ -62,6 +70,11 @@ //-- // Getter/Setter Methods //-- + +public void setEvictionListener( CacheEvictionListener evictionListener ) +{ +this.evictionListener = evictionListener; +} public void setCache( Cache cache ) { Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestCachedProvider.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestCachedProvider.java?rev=345668r1=345667r2=345668view=diff == --- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestCachedProvider.java (original) +++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestCachedProvider.java Sat Nov 19 10:47:10 2005 @@ -18,12 +18,33 @@ import junit.framework.TestCase; import org.apache.commons.proxy.provider.cache.SimpleCache; import org.apache.commons.proxy.provider.cache.ThreadLocalCache; +import org.apache.commons.proxy.provider.cache.CacheEvictionListener; +import org.apache.commons.proxy.provider.cache.CacheEvictionEvent; import org.apache.commons.proxy.util.Echo; import org.apache.commons.proxy.util.EchoImpl; import EDU.oswego.cs.dl.util.concurrent.CountDown; public class TestCachedProvider extends TestCase { +//-- +// Other Methods +//-- + +public void testWithEvictionListener() +{ +final SimpleCache cache = new SimpleCache(); +EchoImpl echo = new EchoImpl(); +final CountingProvider counter = new CountingProvider( new ConstantProvider( echo ) ); +final CachedProvider provider = new CachedProvider( counter
svn commit: r331133 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
Author: imario Date: Sun Nov 6 10:48:29 2005 New Revision: 331133 URL: http://svn.apache.org/viewcvs?rev=331133view=rev Log: try to avoid locking as pointed out by Faron Dutton Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?rev=331133r1=331132r2=331133view=diff == --- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Sun Nov 6 10:48:29 2005 @@ -1,20 +1,28 @@ /* * Copyright 2002-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package org.apache.commons.vfs.cache; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.SoftReference; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.vfs.FileName; @@ -24,244 +32,268 @@ import org.apache.commons.vfs.impl.DefaultFileSystemManager; import org.apache.commons.vfs.util.Messages; -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.SoftReference; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; - /** - * This implementation caches every file as long as it is strongly reachable by the java vm. - * As soon as the vm needs memory - every softly reachable file will be discarded. - * + * This implementation caches every file as long as it is strongly reachable by + * the java vm. As soon as the vm needs memory - every softly reachable file + * will be discarded. + * * @author a href=mailto:[EMAIL PROTECTED]Mario Ivankovits/a - * @version $Revision$ $Date$ + * @version $Revision$ $Date: 2005-09-30 09:02:41 +0200 (Fr, 30 Sep + * 2005) $ * @see SoftReference */ public class SoftRefFilesCache extends AbstractFilesCache { -/** - * The logger to use. - */ -private Log log = LogFactory.getLog(SoftRefFilesCache.class); - -private final Map filesystemCache = new HashMap(); -private final Map refReverseMap = new HashMap(100); -private final ReferenceQueue refqueue = new ReferenceQueue(); - -private SoftRefReleaseThread softRefReleaseThread = null; - -/** - * This thread will listen on the ReferenceQueue and remove the entry in the - * filescache as soon as the vm removes the reference - */ -private class SoftRefReleaseThread extends Thread -{ -private boolean requestEnd = false; - -private SoftRefReleaseThread() -{ -setName(SoftRefReleaseThread.class.getName()); -setDaemon(true); -} - -public void run() -{ -loop: while (!requestEnd !Thread.currentThread().isInterrupted()) -{ -try -{ -Reference ref = refqueue.remove(1000); -if (ref == null) -{ -continue; -} - -synchronized (SoftRefFilesCache.this) -{ -FileSystemAndNameKey key = (FileSystemAndNameKey) refReverseMap.get(ref); - -if (key != null) -{ -removeFile(key); -} -} -} -catch (InterruptedException e
svn commit: r331138 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
Author: imario Date: Sun Nov 6 11:00:34 2005 New Revision: 331138 URL: http://svn.apache.org/viewcvs?rev=331138view=rev Log: some additional changes Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?rev=331138r1=331137r2=331138view=diff == --- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Sun Nov 6 11:00:34 2005 @@ -188,6 +188,8 @@ { Map files = getOrCreateFilesystemCache(filesystem); + boolean closeFilesystem; + synchronized (files) { Iterator iterKeys = refReverseMap.values().iterator(); @@ -201,9 +203,11 @@ files.remove(key.getFileName()); } } + + closeFilesystem = files.size() 1; } - if (files.size() 1) + if (closeFilesystem) { filesystemClose(filesystem); } @@ -231,17 +235,14 @@ { super.close(); - synchronized (this) - { - endThread(); + endThread(); - // files.clear(); - synchronized (filesystemCache) - { - filesystemCache.clear(); - } - refReverseMap.clear(); + // files.clear(); + synchronized (filesystemCache) + { + filesystemCache.clear(); } + refReverseMap.clear(); } public void removeFile(FileSystem filesystem, FileName name) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r331142 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
Author: imario Date: Sun Nov 6 11:07:33 2005 New Revision: 331142 URL: http://svn.apache.org/viewcvs?rev=331142view=rev Log: some cleanup Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?rev=331142r1=331141r2=331142view=diff == --- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Sun Nov 6 11:07:33 2005 @@ -81,8 +81,6 @@ continue; } - FileSystem fsToRemove = null; - FileSystemAndNameKey key = (FileSystemAndNameKey) refReverseMap .get(ref); @@ -90,13 +88,8 @@ { if (removeFile(key)) { - fsToRemove = key.getFileSystem(); + filesystemClose(key.getFileSystem()); } - } - - if (fsToRemove != null) - { - filesystemClose(fsToRemove); } } catch (InterruptedException e) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37249] - [resources] Objects to be prevented from removal from JCS Cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37249. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37249 [EMAIL PROTECTED] changed: What|Removed |Added Summary|Objects to be prevented from|[resources] Objects to be |removal from JCS Cache |prevented from removal from ||JCS Cache -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37249] New: - Objects to be prevented from removal from JCS Cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37249. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37249 Summary: Objects to be prevented from removal from JCS Cache Product: Commons Version: unspecified Platform: PC OS/Version: Windows XP Status: NEW Severity: major Priority: P2 Component: Resources AssignedTo: commons-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] I am using JCS for caching some of my objects on the data layer side of my application. However,i want to have a functionality/callback from where I can prevent my object(s) from being removed fron the cache,even if they have reached their expiry time. This is required in cases where i have taken out an object from cahe for some processing but before i can finish my processing (which may take time),the object theoretically completes it's TTL (time to live)OR the cache reached it's upper limit on no. of objects.Is there any way where I can prevent my objects from being removed from the cache without giving infinite life to them. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r292651 - in /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs: cache/SoftRefFilesCache.java provider/AbstractFileSystem.java provider/zip/ZipFileObject.java provider/zip/Z
Author: imario Date: Fri Sep 30 00:02:41 2005 New Revision: 292651 URL: http://svn.apache.org/viewcvs?rev=292651view=rev Log: enh: try to close the zip file if no one access it Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/zip/ZipFileObject.java jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?rev=292651r1=292650r2=292651view=diff == --- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (original) +++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Fri Sep 30 00:02:41 2005 @@ -79,16 +79,13 @@ continue; } -if (ref != null) +synchronized (SoftRefFilesCache.this) { -synchronized (SoftRefFilesCache.this) -{ -FileSystemAndNameKey key = (FileSystemAndNameKey) refReverseMap.get(ref); +FileSystemAndNameKey key = (FileSystemAndNameKey) refReverseMap.get(ref); -if (key != null) -{ -removeFile(key); -} +if (key != null) +{ +removeFile(key); } } } @@ -131,11 +128,15 @@ public void putFile(final FileObject file) { +if (log.isDebugEnabled()) +{ +log.debug(putFile: + file.getName()); +} synchronized (this) { Map files = getOrCreateFilesystemCache(file.getFileSystem()); -SoftReference ref = new SoftReference(file, refqueue); +Reference ref = new SoftReference(file, refqueue); FileSystemAndNameKey key = new FileSystemAndNameKey(file.getFileSystem(), file.getName()); files.put(file.getName(), ref); refReverseMap.put(ref, key); @@ -189,6 +190,10 @@ private void filesystemClose(FileSystem filesystem) { +if (log.isDebugEnabled()) +{ +log.debug(close fs: + filesystem.getRootName()); +} filesystemCache.remove(filesystem); if (filesystemCache.size() 1) { @@ -222,6 +227,10 @@ private void removeFile(final FileSystemAndNameKey key) { +if (log.isDebugEnabled()) +{ +log.debug(removeFile: + key.getFileName()); +} synchronized (this) { Map files = getOrCreateFilesystemCache(key.getFileSystem()); Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java?rev=292651r1=292650r2=292651view=diff == --- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java (original) +++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java Fri Sep 30 00:02:41 2005 @@ -1,12 +1,12 @@ /* * Copyright 2002-2005 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -61,7 +61,7 @@ /** * Map from FileName to FileObject. */ -private FilesCache files; +// private FilesCache files; /** * Map from FileName to an ArrayList of listeners for that file. @@ -89,7 +89,7 @@ this.rootName = rootName; this.fileSystemOptions = fileSystemOptions; -this.files = null; +// this.files = null; } /** @@ -113,7 +113,7 @@ /** * Close the underlaying link used to access the files */ -protected void closeCommunicationLink() +public
svn commit: r267380 - in /jakarta/commons: dormant/cache/ sandbox/cache/
Author: bayard Date: Fri Sep 2 18:24:52 2005 New Revision: 267380 URL: http://svn.apache.org/viewcvs?rev=267380view=rev Log: Dormant under the new rules Added: jakarta/commons/dormant/cache/ - copied from r267379, jakarta/commons/sandbox/cache/ Removed: jakarta/commons/sandbox/cache/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Additional Comments From [EMAIL PROTECTED] 2005-08-30 22:19 --- FYI, here's the corresponding JBoss bug. They've proposed a similar fix and (per their comments) may roll their own commons-logging-1.0.3 to fix the problem. http://jira.jboss.com/jira/browse/JBAS-1319 -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r240200 - in /jakarta/commons/sandbox/proxy/trunk: ./ src/java/org/apache/commons/proxy/provider/ src/java/org/apache/commons/proxy/provider/cache/ src/test/org/apache/commons/proxy/provid
Author: jcarman Date: Fri Aug 26 04:05:04 2005 New Revision: 240200 URL: http://svn.apache.org/viewcvs?rev=240200view=rev Log: Added cached object providers (threaded/pooled) Added: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/PooledProvider.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/AbstractCache.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/Cache.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/CacheEvictionEvent.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/CacheEvictionListener.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/CachedObject.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/SimpleCache.java jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/ThreadLocalCache.java jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/CountingProvider.java jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestCachedProvider.java jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestPooledProvider.java Modified: jakarta/commons/sandbox/proxy/trunk/build.xml jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml Modified: jakarta/commons/sandbox/proxy/trunk/build.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/build.xml?rev=240200r1=240199r2=240200view=diff == --- jakarta/commons/sandbox/proxy/trunk/build.xml (original) +++ jakarta/commons/sandbox/proxy/trunk/build.xml Fri Aug 26 04:05:04 2005 @@ -58,6 +58,8 @@ runtime-dependency groupId=aopalliance version=1.0/ runtime-dependency groupId=cglib artifactId=cglib-full version=2.0.2/ runtime-dependency groupId=commons-logging version=1.0.4 / +runtime-dependency groupId=commons-pool version=1.2 / +runtime-dependency groupId=commons-collections version=3.1 / runtime-dependency groupId=burlap version=2.1.7/ runtime-dependency groupId=hessian version=3.0.1/ runtime-dependency groupId=axis version=1.2.1 / Modified: jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml?rev=240200r1=240199r2=240200view=diff == --- jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml (original) +++ jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml Fri Aug 26 04:05:04 2005 @@ -129,6 +129,24 @@ SOURCES / /library /orderEntry +orderEntry type=module-library + library +CLASSES + root url=jar://$MODULE_DIR$/lib/runtime/commons-pool/commons-pool.jar!/ / +/CLASSES +JAVADOC / +SOURCES / + /library +/orderEntry +orderEntry type=module-library + library +CLASSES + root url=jar://$MODULE_DIR$/lib/runtime/commons-collections/commons-collections.jar!/ / +/CLASSES +JAVADOC / +SOURCES / + /library +/orderEntry orderEntryProperties / /component /module Added: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java?rev=240200view=auto == --- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java (added) +++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/CachedProvider.java Fri Aug 26 04:05:04 2005 @@ -0,0 +1,51 @@ +/* + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.proxy.provider
DO NOT REPLY [Bug 35900] - [el] Memory Leak: EL Cache entries never removed.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=35900. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=35900 [EMAIL PROTECTED] changed: What|Removed |Added Summary|Memory Leak: EL Cache |[el] Memory Leak: EL Cache |entries never removed. |entries never removed. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 35900] New: - Memory Leak: EL Cache entries never removed.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=35900. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=35900 Summary: Memory Leak: EL Cache entries never removed. Product: Commons Version: 1.0 Final Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: EL AssignedTo: commons-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] This bug refers to the two caches on ExpressionEvaluatorImpl, sCachedExpressionStrings, but primarily sCachedExpectedTypes. Here is a use case to illustrate the problem. A web application typically creates 1,000 different objects of classes it defines using the EL language, and PropertyEditor's. A Tomcat instance is run with 5 of these web applications. Each time one of them is reloaded, a new classloader is created for the web application, so a new set of 1,000 objects is created in the cache. The old objects, and objects they point to (e.g. class and classloader objects), are never garbage collected. The only way to recover the associated memory is to stop and restart Tomcat. There are many possible solutions. A simple one would be to age instances out of the caches after a fixed period of time (say one hour). It would be nice if whatever cache controls are provided are configurable. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 33553] - [configuration] Cache DatabaseConfiguration values for higher performance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=33553. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=33553 [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 33553] - [configuration] Cache DatabaseConfiguration values for higher performance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=33553. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=33553 --- Additional Comments From [EMAIL PROTECTED] 2005-04-14 11:00 --- Created an attachment (id=14708) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14708action=view) Optional preloading I originally sent this patch to the ML because I didn't know of this bugzilla entry. Emmanuel Bourg asked for appending the patch here. My patch adds database preloading optionally and changes less code of DatabaseConfiguration 'internals'. It doesn't fix the bug in closeQuitely() either. I think the user should have the choice to enable/disable preloading (non-enterprise applications with a big configuration table might benefit from not preloading all configuration). -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | --- Additional Comments From [EMAIL PROTECTED] 2005-03-17 08:34 --- As discussed on the commons-dev list, even using WeakHashtable the classloader is not released when LogFactoryImpl is loaded by a parent loader and the Log wrapper is loaded by a child. This is because the LogFactoryImpl holds a reference to the Log in its instances map, and that reference prevents the Log's classloader being released. Will attach a patch to the JUnit tests that show the problem. Sadly, no fix is in the patch :( -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2005-03-17 08:37 --- Created an attachment (id=14501) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14501action=view) Further tests for memory leak The patch includes a new class -- a special classloader that may also be useful in tests of the JCL discovery process. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r155474 [4/4] - in jakarta/commons/sandbox/vfs/trunk: ./ src/java/org/apache/commons/vfs/ src/java/org/apache/commons/vfs/cache/ src/java/org/apache/commons/vfs/events/ src/java/org/apache/commons/vfs/example/ src/java/org/apache/commons/vfs/impl/ src/java/org/apache/commons/vfs/provider/ src/java/org/apache/commons/vfs/provider/bzip2/ src/java/org/apache/commons/vfs/provider/compressed/ src/java/org/apache/commons/vfs/provider/ftp/ src/java/org/apache/commons/vfs/provider/gzip/ src/java/org/apache/commons/vfs/provider/http/ src/java/org/apache/commons/vfs/provider/jar/ src/java/org/apache/commons/vfs/provider/local/ src/java/org/apache/commons/vfs/provider/res/ src/java/org/apache/commons/vfs/provider/sftp/ src/java/org/apache/commons/vfs/provider/smb/ src/java/org/apache/commons/vfs/provider/tar/ src/java/org/apache/commons/vfs/provider/temp/ src/java/org/apache/commons/vfs/provider/url/ src/java/org/apache/commons/vfs/provider/webdav/ src/java/org/apache/commons/vfs/provider/zip/ src/java/org/apache/commons/vfs/tasks/ src/java/org/apache/commons/vfs/util/ src/test-data/basedir/ src/test-data/basedir/dir1/ src/test-data/basedir/dir1/subdir1/ src/test-data/basedir/dir1/subdir2/ src/test-data/basedir/dir1/subdir3/ src/test-data/code/ src/test-data/code/sealed/ src/test/org/apache/commons/ src/test/org/apache/commons/vfs/cache/ src/test/org/apache/commons/vfs/impl/test/ src/test/org/apache/commons/vfs/provider/ftp/test/ src/test/org/apache/commons/vfs/provider/http/test/ src/test/org/apache/commons/vfs/provider/jar/test/ src/test/org/apache/commons/vfs/provider/local/test/ src/test/org/apache/commons/vfs/provider/res/test/ src/test/org/apache/commons/vfs/provider/sftp/test/ src/test/org/apache/commons/vfs/provider/smb/test/ src/test/org/apache/commons/vfs/provider/tar/test/ src/test/org/apache/commons/vfs/provider/temp/test/ src/test/org/apache/commons/vfs/provider/test/ src/test/org/apache/commons/vfs/provider/url/test/ src/test/org/apache/commons/vfs/provider/webdav/test/ src/test/org/apache/commons/vfs/provider/zip/test/ src/test/org/apache/commons/vfs/test/ src/test/org/apache/commons/vfs/util/ xdocs/
Modified: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/LastModifiedTests.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/LastModifiedTests.java?view=diffr1=155473r2=155474 == --- jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/LastModifiedTests.java (original) +++ jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/LastModifiedTests.java Sat Feb 26 05:30:35 2005 @@ -23,7 +23,7 @@ * Test cases for getting and setting file last modified time. * * @author a href=mailto:[EMAIL PROTECTED]Adam Murdoch/a - * @version $Revision: 1.6 $ $Date: 2004/11/08 21:07:44 $ + * @version $Revision$ $Date$ */ public class LastModifiedTests extends AbstractProviderTestCase Propchange: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/LastModifiedTests.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:30:35 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Modified: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/NamingTests.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/NamingTests.java?view=diffr1=155473r2=155474 == --- jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/NamingTests.java (original) +++ jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/NamingTests.java Sat Feb 26 05:30:35 2005 @@ -24,7 +24,7 @@ * Test cases for file naming. * * @author a href=mailto:[EMAIL PROTECTED]Adam Murdoch/a - * @version $Revision: 1.7 $ $Date: 2004/07/07 20:01:35 $ + * @version $Revision$ $Date$ * @todo Add tests for all FileName methods */ public class NamingTests Propchange: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/NamingTests.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:30:35 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Propchange: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderDeleteTests.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:30:35 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Modified: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadTests.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadTests.java?view=diffr1=155473r2=155474 == --- jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadTests.java (original) +++ jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadTests.java Sat Feb 26 05:30:35 2005 @@ -24,7 +24,7 @@ * RanomdRead-only test cases for file providers. * * @author a href=mailto:[EMAIL PROTECTED]Mario Ivankovits/a - * @version $Revision: 1.1 $ $Date$ + * @version $Revision$ $Date$ */ public class ProviderRandomReadTests extends AbstractProviderTestCase Propchange: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadTests.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:30:35 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Modified: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadWriteTests.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadWriteTests.java?view=diffr1=155473r2=155474 == --- jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadWriteTests.java (original) +++ jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadWriteTests.java Sat Feb 26 05:30:35 2005 @@ -25,7 +25,7 @@ * RanomdRead/Write test cases for file providers. * * @author a href=mailto:[EMAIL PROTECTED]Mario Ivankovits/a - * @version $Revision: 1.1 $ $Date: 2004/06/17 19:29:29 $ + * @version $Revision$ $Date$ */ public class ProviderRandomReadWriteTests extends AbstractProviderTestCase Propchange: jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadWriteTests.java
svn commit: r155467 [2/2] - in jakarta/commons/sandbox/simplestore/trunk: ./ docs/ src/block/org/apache/commons/simplestore/block/ src/block/org/apache/commons/simplestore/service/ src/btree/org/apache/commons/simplestore/btree/ src/conf/ src/java/org/apache/commons/simplestore/cache/ src/java/org/apache/commons/simplestore/cache/impl/ src/java/org/apache/commons/simplestore/persistence/ src/java/org/apache/commons/simplestore/persistence/impl/ src/java/org/apache/commons/simplestore/res/ src/java/org/apache/commons/simplestore/tools/ src/jdbc/org/apache/commons/simplestore/jdbc/ src/jdo/org/apache/commons/simplestore/jdo/ src/jdo/org/apache/commons/simplestore/jdo/metadata/ src/query/org/apache/commons/simplestore/query/ src/test/org/apache/commons/simplestore/ src/xmldb/org/apache/commons/simplestore/xmldb/
Propchange: jakarta/commons/sandbox/simplestore/trunk/src/jdo/org/apache/commons/simplestore/jdo/metadata/PackageDescriptor.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:27:41 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Modified: jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQuery.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQuery.java?view=diffr1=155466r2=155467 == --- jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQuery.java (original) +++ jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQuery.java Sat Feb 26 05:27:41 2005 @@ -22,7 +22,7 @@ /** [EMAIL PROTECTED] Juozas Baliuka a href=mailto:[EMAIL PROTECTED] * [EMAIL PROTECTED]/a - [EMAIL PROTECTED]$Id: JexQuery.java,v 1.3 2004/02/28 03:35:47 bayard Exp $ + [EMAIL PROTECTED]$Id$ */ Propchange: jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQuery.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:27:41 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Modified: jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQueryManager.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQueryManager.java?view=diffr1=155466r2=155467 == --- jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQueryManager.java (original) +++ jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQueryManager.java Sat Feb 26 05:27:41 2005 @@ -21,7 +21,7 @@ /** [EMAIL PROTECTED] Juozas Baliuka a href=mailto:[EMAIL PROTECTED] * [EMAIL PROTECTED]/a - [EMAIL PROTECTED]$Id: JexQueryManager.java,v 1.3 2004/02/28 03:35:47 bayard Exp $ + [EMAIL PROTECTED]$Id$ */ Propchange: jakarta/commons/sandbox/simplestore/trunk/src/query/org/apache/commons/simplestore/query/JexQueryManager.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:27:41 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Modified: jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestAll.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestAll.java?view=diffr1=155466r2=155467 == --- jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestAll.java (original) +++ jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestAll.java Sat Feb 26 05:27:41 2005 @@ -20,7 +20,7 @@ /** [EMAIL PROTECTED] Gerhard Froehlich a href=mailto:[EMAIL PROTECTED] * [EMAIL PROTECTED]/a - [EMAIL PROTECTED]$Id: TestAll.java,v 1.16 2004/02/28 03:35:47 bayard Exp $ + [EMAIL PROTECTED]$Id$ */ public class TestAll extends TestCase { public TestAll(String testName) { Propchange: jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestAll.java -- --- svn:keywords (original) +++ svn:keywords Sat Feb 26 05:27:41 2005 @@ -1 +1 @@ -author date id revision +Date Author Id Revision HeadURL Modified: jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestEnhancer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestEnhancer.java?view=diffr1=155466r2=155467 == --- jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestEnhancer.java (original) +++ jakarta/commons/sandbox/simplestore/trunk/src/test/org/apache/commons/simplestore/TestEnhancer.java Sat Feb 26 05:27:41 2005 @@ -24,7 +24,7 @@ /** [EMAIL PROTECTED] Juozas Baliuka a href=mailto:[EMAIL PROTECTED] * [EMAIL PROTECTED]/a - [EMAIL PROTECTED]$Id: TestEnhancer.java,v 1.18 2004/02/28 03:35:47 bayard Exp $ + [EMAIL PROTECTED]$Id$ */ public class TestEnhancer extends TestCase { Propchange:
svn commit: r155513 - in jakarta/commons/sandbox/cache/trunk: ./ .cvsignore
Author: dirkv Date: Sat Feb 26 05:47:48 2005 New Revision: 155513 URL: http://svn.apache.org/viewcvs?view=revrev=155513 Log: convert .cvsignore to svn:ignore Removed: jakarta/commons/sandbox/cache/trunk/.cvsignore Modified: jakarta/commons/sandbox/cache/trunk/ (props changed) Propchange: jakarta/commons/sandbox/cache/trunk/ -- (empty) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 33553] - [configuration] Cache DatabaseConfiguration values for higher performance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=33553. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=33553 [EMAIL PROTECTED] changed: What|Removed |Added Summary|Cache DatabaseConfiguration |[configuration] Cache |values for higher |DatabaseConfiguration values |performance |for higher performance --- Additional Comments From [EMAIL PROTECTED] 2005-02-14 10:16 --- Adding a cache to DatabaseConfiguration is a good idea. However I'm not sure I would rely solely on the cache for some operations like isEmpty() or containsKey(). The cache should be first checked, and then the database should be queried if necessary. Checking if the cache is empty isn't enough to make sure the configuration is empty. Just out of curiosity, why did you change the private members to final ? -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 33553] - [configuration] Cache DatabaseConfiguration values for higher performance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=33553. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=33553 --- Additional Comments From [EMAIL PROTECTED] 2005-02-14 15:48 --- I'm working on a refresh approach like what is done for properties. With that, then the cache will always be at most x seconds older than the database, so my hope is that the querying the cache will be sufficient. What I might do is take and refactor out the real logic of isEmpty etc to the strategey. Have one strategy which always queries the database, one strategy which uses a cache and refreshes etc. The downside there is it kinda kills my idea of having a generic reloading strategy which could be used for xml, properties files and database. Perhaps that's just a pipe dream. :-) As far as the finals go, that's something I always do with instance variables which are set in the constructor and then never change. It has two advantages: 1) compiler makes sure that I initialize the fields before use and 2) compiler can apply optimizations (inining, direct memory access etc.) Also, with the default settings for checkstyle which I've kinda gotten ingrained in me now, checkstyle recommends setting those puppies to final. :-) -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 33553] New: - Cache DatabaseConfiguration values for higher performance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=33553. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=33553 Summary: Cache DatabaseConfiguration values for higher performance Product: Commons Version: unspecified Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Configuration AssignedTo: commons-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] The DatabaseConfiguration class queries each property as it gets the request for each property. This is nice for ensuring that you're always up to date, but it doesn't give very good performance in enterprise applications, where the database may not be on the same subnet. What we need is the ability to hit the database once, get all the keys/values and then serve up getString etc. from that cache. I'll be opening a separate enhancement to have a generic Reloading Strategy which could then be applied to this caching DatabaseConfiguration approach. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 33553] - Cache DatabaseConfiguration values for higher performance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=33553. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=33553 --- Additional Comments From [EMAIL PROTECTED] 2005-02-14 07:07 --- Created an attachment (id=14276) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14276action=view) Patch to implement this. This patch, in addition to implementing the caching DB behavior, also corrects a minor bug in closeQuietly, where a SQLException in the stmnt.close() call would prevent the connection from ever being closed. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 33553] - Cache DatabaseConfiguration values for higher performance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=33553. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=33553 [EMAIL PROTECTED] changed: What|Removed |Added Attachment #14276|0 |1 is obsolete|| --- Additional Comments From [EMAIL PROTECTED] 2005-02-14 07:45 --- Created an attachment (id=14277) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14277action=view) Patch to implement this. This one checks out clean in checkstyle. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r151593 - in jakarta/commons/sandbox: cache/trunk/xdocs/ clazz/trunk/ clazz/trunk/xdocs/ cli/trunk/ compress/trunk/xdocs/ contract/trunk/xdocs/ convert/trunk/xdocs/ email/trunk/xdocs/ events/trunk/ events/trunk/xdocs/ feedparser/trunk/xdocs/
Author: dirkv Date: Sun Feb 6 07:54:24 2005 New Revision: 151593 URL: http://svn.apache.org/viewcvs?view=revrev=151593 Log: CVS = SVN conversion Modified: jakarta/commons/sandbox/cache/trunk/xdocs/index.xml jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml jakarta/commons/sandbox/clazz/trunk/PROPOSAL.html jakarta/commons/sandbox/clazz/trunk/build.xml jakarta/commons/sandbox/clazz/trunk/xdocs/index.xml jakarta/commons/sandbox/clazz/trunk/xdocs/navigation.xml jakarta/commons/sandbox/cli/trunk/project.xml jakarta/commons/sandbox/compress/trunk/xdocs/index.xml jakarta/commons/sandbox/compress/trunk/xdocs/navigation.xml jakarta/commons/sandbox/contract/trunk/xdocs/downloads.xml jakarta/commons/sandbox/contract/trunk/xdocs/navigation.xml jakarta/commons/sandbox/convert/trunk/xdocs/index.xml jakarta/commons/sandbox/convert/trunk/xdocs/navigation.xml jakarta/commons/sandbox/email/trunk/xdocs/downloads.xml jakarta/commons/sandbox/email/trunk/xdocs/index.xml jakarta/commons/sandbox/email/trunk/xdocs/navigation.xml jakarta/commons/sandbox/events/trunk/PROPOSAL.html jakarta/commons/sandbox/events/trunk/xdocs/index.xml jakarta/commons/sandbox/events/trunk/xdocs/navigation.xml jakarta/commons/sandbox/feedparser/trunk/xdocs/downloads.xml Modified: jakarta/commons/sandbox/cache/trunk/xdocs/index.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache/trunk/xdocs/index.xml?view=diffr1=151592r2=151593 == --- jakarta/commons/sandbox/cache/trunk/xdocs/index.xml (original) +++ jakarta/commons/sandbox/cache/trunk/xdocs/index.xml Sun Feb 6 07:54:24 2005 @@ -48,11 +48,11 @@ section name=Documentation p ul - liThe a href=apidocs/index.htmlJavadoc/a of the latest CVS/li + liThe a href=apidocs/index.htmlJavadoc/a of the latest SVN/li liInformation about using the - a href=http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-commons-sandbox/cache/docs/tagext.html?rev=HEADamp;content-type=text/html; + a href=http://svn.apache.org/viewcvs/*checkout*/jakarta/commons/sandbox/cache/trunk/docs/tagext.html; Tag library/a/li - liThe a href=http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cache/;CVS repository/a can be browsed./li + liThe a href=http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache/;SVN repository/a can be browsed./li /ul /p /section Modified: jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml?view=diffr1=151592r2=151593 == --- jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml (original) +++ jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml Sun Feb 6 07:54:24 2005 @@ -20,11 +20,11 @@ body menu name=Commons#xA0;Cache item name=Overview href=/index.html/ - item name=Tag library href=http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-commons-sandbox/cache/docs/tagext.html?rev=HEADamp;content-type=text/html; / + item name=Tag library href=http://svn.apache.org/viewcvs/*checkout*/jakarta/commons/sandbox/cache/trunk/docs/tagext.html; / item name=Javadoc href=/apidocs/index.html/ item name=Mailing lists href=/mail-lists.html/ item name=Team href=/team-list.html/ - item name=CVS href=http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cache// + item name=SVN href=http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache// /menu common-menus; /body Modified: jakarta/commons/sandbox/clazz/trunk/PROPOSAL.html URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/clazz/trunk/PROPOSAL.html?view=diffr1=151592r2=151593 == --- jakarta/commons/sandbox/clazz/trunk/PROPOSAL.html (original) +++ jakarta/commons/sandbox/clazz/trunk/PROPOSAL.html Sun Feb 6 07:54:24 2005 @@ -104,8 +104,8 @@ h3(3) Required Jakarta-Commons Resources/h3 ul -liCVS Repository - New directory codeclazz/code in the -codejakarta-commons/code CVS repository./li +liSVN repository - New directory codeclazz/code in the +codejakarta-commons/code SVN repository./li liMailing List - Discussions will take place on the general emcommons-dev@jakarta.apache.org/em mailing list. To help list subscribers identify messages of interest, it is suggested that Modified: jakarta/commons/sandbox/clazz/trunk/build.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/clazz/trunk/build.xml?view=diffr1=151592r2=151593 == --- jakarta/commons/sandbox/clazz/trunk/build.xml (original) +++ jakarta/commons/sandbox/clazz/trunk/build.xml Sun Feb 6 07:54:24 2005 @@ -18,7
Re: [cache] javadoc missing ?
It was a problem in the project descriptor, should be fixed now. Thanks Dirk Paul Libbrecht wrote: Hi, I noticed the javadoc of commons-sandbox-cache is actually missing the most interesting pacakge, org.apache.commons.cache and only include three packages one level below. Is there something I missed ? paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cache
Looks interesting, is this class you wrote an extension of the existing classes/interfaces? If this is the case then contributing is simple. You post a copy of your code to the commons-dev mailing list. I or another committer will review and commit the code. (I assume you have some JUnit tests showing all the nice features) All contributed code must be licensed under the apache license (please add the ASF header to new files) with no other copyrights (remove your own copyright from the copy you are submitting). The version you submit is then owned by the ASF (licensed under the ASF 2.0 license) and you will be listed as contributer on the cache website. Cheers Dirk Matthias Nott wrote: Y'all, I've here some Cache class code that I've written and used over the last two years that I'd like to contribute. Features are listed below. I wonder whether this may fit into commons cache, and if so, drop me a note. Thanks and keep up the good work, M /** * This class provides the user with an object cache. * p * This cache has a general structure of an optimized queue (FIFO). The * following rules apply: * ul * liWhen an entry is added to the cache, it is added to the head of the * queue./li * liIf the maximum number of entries in the queue is reached, adding an * entry to the head at the same time moves out one object from the tail. * The cache size can be controlled by the setCacheSize function. The * default cache size is 1000 entries./li * liHitting any entry in the cache moves it back to the head of the queue. * This way, more frequently accessed entries are more likely to remain in the * cache./li * liWhen a maximum number of cache modification has been reached, the entire * cache is flushed. This can be controlled by the setResetAfter function. * The default threshold is 100 structural cache modifications./li * liEach cache entry gets a standard lifetime which is forever if you do * not use the setLifetime function. If you use that function or choose * a particular setting for one given entry using the more detailed * version of the setEntry function, the entries will be cleaned up * either by a cleaner thread that is started automatically when you * instantiate the cache, or by the fact that you access an expired * item before the next run of the cleaner thread took place. The * default interval for the cleaner is 1 minute. This can be controlled * by the setUpdateInterval function./li * liEach cache entry is encapsulated in a SoftReference. This means, * that when running into an out of memory situation, some entries * may be moved out of the cache by the garbage collector. As you * have no control whatsoever over which entries are removed, it * is important to understand that byou must not rely on the fact * that an entry is in the cache only because you had just put it there./b * Each time you access the cache using the getEntry function, you must * check whether you received a null object, and if so, you have to * take care yourself for recreating the object from scratch - and for * adding it back to the cache if you want./li * liIt is possible to compress the cache content if you have huge but * redundant objects to store. To do so, use the setCompressed function * to activate this setting for the entire cache, or activate it only * for single calls to setEntry in its detailed form. When getting * an object from the cache, the cache takes care of decompressing * the entry, so you do not have to worry about whether any entry had * been compressed previously. Please make sure to note that the * compression takes place in memory, and may imply a severe load * on the CPU./li * liWhen compressing, it is possible to activate a double buffer * for single entries or for the entire cache using the setDoublebuffer * function. When doing so, storing and hitting a cache entry will * automatically try to maintain a SoftReference to the uncompressed * form, thus considerably speeding up subsequent hits to the same * entry. The downside is, however, that this decompressed entry * now competes for memory space with all other cache entries, * whether compressed or not. So make sure to monitor, e.g. using * the getCacheHit vs. getCacheMiss functions, whether the setting * renders the entire cache inactive such that hitting a huge cache * entry forces all other cache entries out of the cache immediately. * The cache statistics can be reset by the resetStatistics function./li * liIt is very probable that using the double buffer and the compression * as an overall cache setting does not make sense. All tests that have * been untertaken so far show that the doublebuffer takes up at least * the space, if not more, that the uncompressed objects would take
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2005-02-07 00:33 --- Committed. Many thanks. I'm closing this one now (but please feel free to open new reports for any new improvements). Robert -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cache
Y'all, I've here some Cache class code that I've written and used over the last two years that I'd like to contribute. Features are listed below. I wonder whether this may fit into commons cache, and if so, drop me a note. Thanks and keep up the good work, M /** * This class provides the user with an object cache. * p * This cache has a general structure of an optimized queue (FIFO). The * following rules apply: * ul * liWhen an entry is added to the cache, it is added to the head of the * queue./li * liIf the maximum number of entries in the queue is reached, adding an * entry to the head at the same time moves out one object from the tail. * The cache size can be controlled by the setCacheSize function. The * default cache size is 1000 entries./li * liHitting any entry in the cache moves it back to the head of the queue. * This way, more frequently accessed entries are more likely to remain i n the * cache./li * liWhen a maximum number of cache modification has been reached, the entire * cache is flushed. This can be controlled by the setResetAfter function. * The default threshold is 100 structural cache modifications./li * liEach cache entry gets a standard lifetime which is forever if you do * not use the setLifetime function. If you use that function or choose * a particular setting for one given entry using the more detailed * version of the setEntry function, the entries will be cleaned up * either by a cleaner thread that is started automatically when you * instantiate the cache, or by the fact that you access an expired * item before the next run of the cleaner thread took place. The * default interval for the cleaner is 1 minute. This can be controlled * by the setUpdateInterval function./li * liEach cache entry is encapsulated in a SoftReference. This means, * that when running into an out of memory situation, some entries * may be moved out of the cache by the garbage collector. As you * have no control whatsoever over which entries are removed, it * is important to understand that byou must not rely on the fact * that an entry is in the cache only because you had just put it there./b * Each time you access the cache using the getEntry function, you must * check whether you received a null object, and if so, you have to * take care yourself for recreating the object from scratch - and for * adding it back to the cache if you want./li * liIt is possible to compress the cache content if you have huge but * redundant objects to store. To do so, use the setCompressed function * to activate this setting for the entire cache, or activate it only * for single calls to setEntry in its detailed form. When getting * an object from the cache, the cache takes care of decompressing * the entry, so you do not have to worry about whether any entry had * been compressed previously. Please make sure to note that the * compression takes place in memory, and may imply a severe load * on the CPU./li * liWhen compressing, it is possible to activate a double buffer * for single entries or for the entire cache using the setDoublebuffer * function. When doing so, storing and hitting a cache entry will * automatically try to maintain a SoftReference to the uncompressed * form, thus considerably speeding up subsequent hits to the same * entry. The downside is, however, that this decompressed entry * now competes for memory space with all other cache entries, * whether compressed or not. So make sure to monitor, e.g. using * the getCacheHit vs. getCacheMiss functions, whether the setting * renders the entire cache inactive such that hitting a huge cache * entry forces all other cache entries out of the cache immediately. * The cache statistics can be reset by the resetStatistics function./li * liIt is very probable that using the double buffer and the compression * as an overall cache setting does not make sense. All tests that have * been untertaken so far show that the doublebuffer takes up at least * the space, if not more, that the uncompressed objects would take, * thus moving objects out of the cache that should have been kept * there. On the other hand, double buffering and compressing makes * a lot of sense to use on isolated cache entries. Think of getting * a list of values that imay/i be bigger than a given threshold * that you define; in this case, you use the detailed version of the * setEntry function and store only this entry in a compressed form, * activating the double buffer at the same time. If the object is * accessed frequently, the double buffer will eliminate subsequent * decompressions and trade
[cache] javadoc missing ?
Hi, I noticed the javadoc of commons-sandbox-cache is actually missing the most interesting pacakge, org.apache.commons.cache and only include three packages one level below. Is there something I missed ? paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2005-02-01 08:45 --- Created an attachment (id=14148) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14148action=view) Update to the User Guide Attached is a patch to guide.xml that includes discussion of the issues in this bug and the fix. Also includes discussion of what the various jars in the standard distribution are, in order to give some context to the above. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r149155 - jakarta/commons/sandbox/cache/trunk/build.xml
Author: craigmcc Date: Sun Jan 30 13:12:47 2005 New Revision: 149155 URL: http://svn.apache.org/viewcvs?view=revrev=149155 Log: Remove unnecessary dependence on LICENSE file in parent directory. Modified: jakarta/commons/sandbox/cache/trunk/build.xml Modified: jakarta/commons/sandbox/cache/trunk/build.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache/trunk/build.xml?view=diffr1=149154r2=149155 == --- jakarta/commons/sandbox/cache/trunk/build.xml (original) +++ jakarta/commons/sandbox/cache/trunk/build.xml Sun Jan 30 13:12:47 2005 @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. -- -!-- $Id: build.xml,v 1.3 2004/02/24 21:34:16 scolebourne Exp $ -- +!-- $Id$ -- project name=commons-cache default=test basedir=. !-- patternset describing files to be copied from the doc directory -- @@ -138,7 +138,7 @@ target name=doc-top depends=init mkdir dir=${dest}/ - copy todir=${dest} file=../LICENSE/ + copy todir=${dest} file=LICENSE.txt/ /target target name=doc-copy depends=init if=available-doc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r149167 - in jakarta/commons/sandbox/cache/trunk: project.properties project.xml xdocs/navigation.xml
Author: dirkv Date: Sun Jan 30 14:11:26 2005 New Revision: 149167 URL: http://svn.apache.org/viewcvs?view=revrev=149167 Log: using svn:externals the commons-build directory is included into trunks-sandbox, this removes the dependency on the ../jakarta-commons/ directory path Modified: jakarta/commons/sandbox/cache/trunk/project.properties jakarta/commons/sandbox/cache/trunk/project.xml jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml Modified: jakarta/commons/sandbox/cache/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache/trunk/project.properties?view=diffr1=149166r2=149167 == --- jakarta/commons/sandbox/cache/trunk/project.properties (original) +++ jakarta/commons/sandbox/cache/trunk/project.properties Sun Jan 30 14:11:26 2005 @@ -14,9 +14,9 @@ ## # Properties that override Maven build defaults -# $Id: project.properties,v 1.3 2004/05/30 21:02:41 dirkv Exp $ +# $Id$ ## - +maven.changelog.factory=org.apache.maven.svnlib.SvnChangeLogFactory ## @@ -42,11 +42,12 @@ ## # commons site LF ## -maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl +maven.xdoc.jsl=../commons-build/commons-site.jsl maven.xdoc.date=bottom maven.xdoc.poweredby.image=maven-feather.png maven.xdoc.version=${pom.currentVersion} maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html +maven.xdoc.includeProjectDocumentation=yes # once we create a theme url it should go here. #maven.xdoc.theme.url= Modified: jakarta/commons/sandbox/cache/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache/trunk/project.xml?view=diffr1=149166r2=149167 == --- jakarta/commons/sandbox/cache/trunk/project.xml (original) +++ jakarta/commons/sandbox/cache/trunk/project.xml Sun Jan 30 14:11:26 2005 @@ -15,7 +15,7 @@ limitations under the License. -- project - extend../sandbox-build/project.xml/extend + extend../commons-build/sandbox-project.xml/extend nameCommons Cache/name idcommons-cache/id Modified: jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml?view=diffr1=149166r2=149167 == --- jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml (original) +++ jakarta/commons/sandbox/cache/trunk/xdocs/navigation.xml Sun Jan 30 14:11:26 2005 @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. -- -!DOCTYPE org.apache.commons.menus SYSTEM '../../../jakarta-commons/commons-build/menus/menus.dtd' +!DOCTYPE org.apache.commons.menus SYSTEM '../../commons-build/menus/menus.dtd' project name=Commons#xA0;Cache titleCommons#xA0;Cache/title body - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jelly] a memory leak fix without a tag cache
This didn't apply for me: 1) It says Index: at line 124 is invalid 2) if I trim to just JellyContext, one of the hunks fails How did you generate it? IT is also in dos format, so I assume it was winCVS or something? Can you try maven scm:cvs-create-patch? Thanks, Brett Hans Gilde wrote: Heres a patch for HEAD with a thread-safe cache thats got no JellyContext tag cache, no memory leak and no dumb WeakReferences. And it even passes the unit tests. Its so simple that it was invisible; its less than 10 lines of change from the pre-RC1 TagScript. Sigh. Anyway, I didnt want to commit it because we already have consensus on the tag cache. Could everyone test with this one too? If it works, Ill commit it. Hans Index: src/java/org/apache/commons/jelly/JellyContext.java === RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v retrieving revision 1.66 diff -u -r1.66 JellyContext.java --- src/java/org/apache/commons/jelly/JellyContext.java 27 Jan 2005 05:52:27 - 1.66 +++ src/java/org/apache/commons/jelly/JellyContext.java 27 Jan 2005 06:11:11 - @@ -92,20 +92,6 @@ /** Should we export tag libraries to our parents context */ private boolean exportLibraries = true; -/** Maps a Thread to its local Script data cache. It's - * like a ThreadLocal, but it reclaims memory better - * when the JellyCointext goes out of scope. - * This isn't a ThreadLocal because of the typical usage scenario of - * JellyContext. ThreadLocal is meant to be sued as a static variable, - * we were using it as a local variable. - * [EMAIL PROTECTED] #setThreadLocalScriptData(Script,Object)} - */ -private Map threadLocalScriptData = Collections.synchronizedMap(new WeakHashMap()); -// THINKME: Script objects are like Object (for equals and hashCode) I think. -// It should be asy to optimize hash-map distribution, e.g. by -// shifting the hashcode return value (presuming Object.hashcode() -// is something like an address) - /** * Create a new context with the currentURL set to the rootURL */ @@ -390,93 +376,20 @@ return createChildContext(); } - -/** Gets the Script data item that may have previously been stored - * by the script, in this context, for the current thread. - * - * @return the tag associated with the current context and thread - */ -public Object getThreadScriptData(Script script) { -if( script == null ) -return null; -Tag tag = (Tag) getThreadScriptDataMap().get(script); - if( tag == null getParent() != null) { - return getParent().getThreadScriptData(script); - } else { - return tag; - } -} - - /** Gets a per-thread (thread local) Map of data for use by - * Scripts. - * @return the thread local Map of Script data */ - public Map getThreadScriptDataMap() { -Map rv; -Thread t = Thread.currentThread(); -Map data = (Map) threadLocalScriptData.get(t); -if (data == null) { -rv = new HashMap(); -threadLocalScriptData.put(t, rv); -} else { -rv = data; -} - return rv; - } - -/** Stores an object that lasts for the life of this context - * and is local to the current thread. This method is - * mainly intended to store Tag instances. However, any - * Script that wants to cache data can use this - * method. - */ -public void setThreadScriptData(Script script, Object data) { -getThreadScriptDataMap().put(script,data); -} - -/** Clears variables set by Tags (basically, variables set in a Jelly script) - * and data stored by [EMAIL PROTECTED] Script} instances. +/** Clears variables set by Tags. * @see #clearVariables() - * @see #clearThreadScriptData() - * @see #clearScriptData() */ public void clear() { -clearScriptData(); clearVariables(); } /** Clears variables set by Tags (variables set while running a Jelly script) * @see #clear() - * @see #clearThreadScriptData() - * @see #clearScriptData() */ -public void clearVariables() { +protected void clearVariables() { variables.clear(); } -/** Clears data cached by [EMAIL PROTECTED] Script} instances, - * for this context, strongfor the current thread/strong. - * The data cleared could be cached Tag instances or other data - * saved by Script classes. - * @see #clear() - * @see #clearVariables() - * @see #clearScriptData() - */ -public void clearThreadScriptData() { -getThreadScriptDataMap().clear(); -} - -/** Clears data cached by [EMAIL PROTECTED] Script} instances, - * for this context, strongfor all threads
Re: [jelly] a memory leak fix without a tag cache
Le 27 janv. 05, à 13:40, Brett Porter a écrit : Can you try maven scm:cvs-create-patch? One day maven will make me coffee! How do you apply the patch with maven ? paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE : [jelly] a memory leak fix without a tag cache
Can you try maven scm:cvs-create-patch? One day maven will make me coffee! It doesn't ? I stop trying to understand it now. For french people, excellent maven manual online: http://etudiant.univ-mlv.fr/~mvongvil/Maven_Intro.htm Marc DEXET
Re: [jelly] a memory leak fix without a tag cache
I've managed to apply the patch by hand. Am testing now. Alternatives are always good! On Thu, 27 Jan 2005 01:21:11 -0500, Hans Gilde [EMAIL PROTECTED] wrote: Here's a patch for HEAD with a thread-safe cache that's got no JellyContext tag cache, no memory leak and no dumb WeakReferences. And it even passes the unit tests. It's so simple that it was invisible; it's less than 10 lines of change from the pre-RC1 TagScript. Sigh. Anyway, I didn't want to commit it because we already have consensus on the tag cache. Could everyone test with this one too? If it works, I'll commit it. Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://www.multitask.com.au/people/dion/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE : [jelly] a memory leak fix without a tag cache
Hey Marc, that is a good read! On Thu, 27 Jan 2005 15:16:33 +0100, Marc DEXET [EMAIL PROTECTED] wrote: Can you try maven scm:cvs-create-patch? One day maven will make me coffee! It doesn't ? I stop trying to understand it now. For french people, excellent maven manual online: http://etudiant.univ-mlv.fr/~mvongvil/Maven_Intro.htm Marc DEXET -- http://www.multitask.com.au/people/dion/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jelly] a memory leak fix without a tag cache
Can you produce a patch on the command-line for us ? thanks paul Le 27 janv. 05, à 15:53, Dion Gillard a écrit : I've managed to apply the patch by hand. Am testing now. Alternatives are always good! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jelly] a memory leak fix without a tag cache
Attached. On Thu, 27 Jan 2005 16:08:12 +0100, Paul Libbrecht [EMAIL PROTECTED] wrote: Can you produce a patch on the command-line for us ? thanks paul Le 27 janv. 05, à 15:53, Dion Gillard a écrit : I've managed to apply the patch by hand. Am testing now. Alternatives are always good! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://www.multitask.com.au/people/dion/ Index: src/java/org/apache/commons/jelly/JellyContext.java === RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v retrieving revision 1.66 diff -u -r1.66 JellyContext.java --- src/java/org/apache/commons/jelly/JellyContext.java 27 Jan 2005 05:52:27 - 1.66 +++ src/java/org/apache/commons/jelly/JellyContext.java 27 Jan 2005 15:16:59 - @@ -20,12 +20,9 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.util.Collections; -import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; -import java.util.WeakHashMap; import org.apache.commons.jelly.parser.XMLParser; import org.apache.commons.jelly.util.ClassLoaderUtils; @@ -92,20 +89,6 @@ /** Should we export tag libraries to our parents context */ private boolean exportLibraries = true; -/** Maps a Thread to its local Script data cache. It's - * like a ThreadLocal, but it reclaims memory better - * when the JellyCointext goes out of scope. - * This isn't a ThreadLocal because of the typical usage scenario of - * JellyContext. ThreadLocal is meant to be sued as a static variable, - * we were using it as a local variable. - * [EMAIL PROTECTED] #setThreadLocalScriptData(Script,Object)} - */ -private Map threadLocalScriptData = Collections.synchronizedMap(new WeakHashMap()); -// THINKME: Script objects are like Object (for equals and hashCode) I think. -// It should be asy to optimize hash-map distribution, e.g. by -// shifting the hashcode return value (presuming Object.hashcode() -// is something like an address) - /** * Create a new context with the currentURL set to the rootURL */ @@ -389,94 +372,23 @@ public JellyContext newJellyContext() { return createChildContext(); } - -/** Gets the Script data item that may have previously been stored - * by the script, in this context, for the current thread. - * - * @return the tag associated with the current context and thread - */ -public Object getThreadScriptData(Script script) { -if( script == null ) -return null; -Tag tag = (Tag) getThreadScriptDataMap().get(script); - if( tag == null getParent() != null) { - return getParent().getThreadScriptData(script); - } else { - return tag; - } -} - - /** Gets a per-thread (thread local) Map of data for use by - * Scripts. - * @return the thread local Map of Script data */ - public Map getThreadScriptDataMap() { -Map rv; -Thread t = Thread.currentThread(); -Map data = (Map) threadLocalScriptData.get(t); -if (data == null) { -rv = new HashMap(); -threadLocalScriptData.put(t, rv); -} else { -rv = data; -} - return rv; - } - -/** Stores an object that lasts for the life of this context - * and is local to the current thread. This method is - * mainly intended to store Tag instances. However, any - * Script that wants to cache data can use this - * method. - */ -public void setThreadScriptData(Script script, Object data) { -getThreadScriptDataMap().put(script,data); -} - + /** Clears variables set by Tags (basically, variables set in a Jelly script) * and data stored by [EMAIL PROTECTED] Script} instances. * @see #clearVariables() - * @see #clearThreadScriptData() - * @see #clearScriptData() */ public void clear() { -clearScriptData(); clearVariables(); } - + /** Clears variables set by Tags (variables set while running a Jelly script) * @see #clear() - * @see #clearThreadScriptData() - * @see #clearScriptData() */ public void clearVariables() { variables.clear(); } - -/** Clears data cached by [EMAIL PROTECTED] Script} instances, - * for this context, strongfor the current thread/strong. - * The data cleared could be cached Tag instances or other data - * saved by Script classes. - * @see #clear() - * @see #clearVariables() - * @see
Re: [jelly] a memory leak fix without a tag cache
Awesome. Worked. And... it works for my reloadable test for which I was fearing much! paul Le 27 janv. 05, à 16:18, Dion Gillard a écrit : Attached. On Thu, 27 Jan 2005 16:08:12 +0100, Paul Libbrecht [EMAIL PROTECTED] wrote: Can you produce a patch on the command-line for us ? thanks paul Le 27 janv. 05, à 15:53, Dion Gillard a écrit : I've managed to apply the patch by hand. Am testing now. Alternatives are always good! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://www.multitask.com.au/people/dion/ hans- patch.txt- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jelly] a memory leak fix without a tag cache
It's worked for me on Sun JDKs 1.3,1.4 and 1.5 and IBM JDK 1.4 on Windows. I've also asked the HtmlUnit guys if they could test either this or CVS HEAD, as I know they had issues with RC1. On Thu, 27 Jan 2005 16:52:34 +0100, Paul Libbrecht [EMAIL PROTECTED] wrote: Awesome. Worked. And... it works for my reloadable test for which I was fearing much! paul Le 27 janv. 05, à 16:18, Dion Gillard a écrit : Attached. On Thu, 27 Jan 2005 16:08:12 +0100, Paul Libbrecht [EMAIL PROTECTED] wrote: Can you produce a patch on the command-line for us ? thanks paul Le 27 janv. 05, à 15:53, Dion Gillard a écrit : I've managed to apply the patch by hand. Am testing now. Alternatives are always good! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://www.multitask.com.au/people/dion/ hans- patch.txt- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://www.multitask.com.au/people/dion/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jelly] a memory leak fix without a tag cache
Heres a patch for HEAD with a thread-safe cache thats got no JellyContext tag cache, no memory leak and no dumb WeakReferences. And it even passes the unit tests. Its so simple that it was invisible; its less than 10 lines of change from the pre-RC1 TagScript. Sigh. Anyway, I didnt want to commit it because we already have consensus on the tag cache. Could everyone test with this one too? If it works, Ill commit it. Hans Index: src/java/org/apache/commons/jelly/JellyContext.java === RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v retrieving revision 1.66 diff -u -r1.66 JellyContext.java --- src/java/org/apache/commons/jelly/JellyContext.java 27 Jan 2005 05:52:27 - 1.66 +++ src/java/org/apache/commons/jelly/JellyContext.java 27 Jan 2005 06:11:11 - @@ -92,20 +92,6 @@ /** Should we export tag libraries to our parents context */ private boolean exportLibraries = true; -/** Maps a Thread to its local Script data cache. It's - * like a ThreadLocal, but it reclaims memory better - * when the JellyCointext goes out of scope. - * This isn't a ThreadLocal because of the typical usage scenario of - * JellyContext. ThreadLocal is meant to be sued as a static variable, - * we were using it as a local variable. - * [EMAIL PROTECTED] #setThreadLocalScriptData(Script,Object)} - */ -private Map threadLocalScriptData = Collections.synchronizedMap(new WeakHashMap()); -// THINKME: Script objects are like Object (for equals and hashCode) I think. -// It should be asy to optimize hash-map distribution, e.g. by -// shifting the hashcode return value (presuming Object.hashcode() -// is something like an address) - /** * Create a new context with the currentURL set to the rootURL */ @@ -390,93 +376,20 @@ return createChildContext(); } - -/** Gets the Script data item that may have previously been stored - * by the script, in this context, for the current thread. - * - * @return the tag associated with the current context and thread - */ -public Object getThreadScriptData(Script script) { -if( script == null ) -return null; -Tag tag = (Tag) getThreadScriptDataMap().get(script); - if( tag == null getParent() != null) { - return getParent().getThreadScriptData(script); - } else { - return tag; - } -} - - /** Gets a per-thread (thread local) Map of data for use by - * Scripts. - * @return the thread local Map of Script data */ - public Map getThreadScriptDataMap() { -Map rv; -Thread t = Thread.currentThread(); -Map data = (Map) threadLocalScriptData.get(t); -if (data == null) { -rv = new HashMap(); -threadLocalScriptData.put(t, rv); -} else { -rv = data; -} - return rv; - } - -/** Stores an object that lasts for the life of this context - * and is local to the current thread. This method is - * mainly intended to store Tag instances. However, any - * Script that wants to cache data can use this - * method. - */ -public void setThreadScriptData(Script script, Object data) { -getThreadScriptDataMap().put(script,data); -} - -/** Clears variables set by Tags (basically, variables set in a Jelly script) - * and data stored by [EMAIL PROTECTED] Script} instances. +/** Clears variables set by Tags. * @see #clearVariables() - * @see #clearThreadScriptData() - * @see #clearScriptData() */ public void clear() { -clearScriptData(); clearVariables(); } /** Clears variables set by Tags (variables set while running a Jelly script) * @see #clear() - * @see #clearThreadScriptData() - * @see #clearScriptData() */ -public void clearVariables() { +protected void clearVariables() { variables.clear(); } -/** Clears data cached by [EMAIL PROTECTED] Script} instances, - * for this context, strongfor the current thread/strong. - * The data cleared could be cached Tag instances or other data - * saved by Script classes. - * @see #clear() - * @see #clearVariables() - * @see #clearScriptData() - */ -public void clearThreadScriptData() { -getThreadScriptDataMap().clear(); -} - -/** Clears data cached by [EMAIL PROTECTED] Script} instances, - * for this context, strongfor all threads/strong. - * The data cleared could be cached Tag instances or other data - * saved by Script classes. - * @see #clear() - * @see #clearThreadScriptData() - * @see #clearVariables
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2004-12-15 11:36 --- Hi Brian Apologies for my tardiness (caught the traditional British Christmas Cold). Good patch, committed. I suspect that we're approaching the end of the line for this bug now. I still need to pull together some documentation and integrate it with the existing stuff. So I'll leave this open as a reminder. You might like to resubscribe to commons-dev (perhaps through www.gmane.org if the volume is offputting) since a lot of discussions have kicked off (involved IBM amongst others) about the future of commons logging and enterprise logging in general. I'm sure you're input would be welcomed. Robert -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2004-12-04 08:40 --- Created an attachment (id=13646) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=13646action=view) WeakHashtable uses strong refs to values OK, got a chance to change WeakHashtable to simple strong references to its values. Patch attached. The patch also follows up on a thought we'd mentioned on the dev list. Every 10 puts it checks the ReferenceQueue and, if needed, purges one dead entry. Housekeeping in small doses ;-) I also added this behavior to remove(). Also changed a couple local variable names Eclipse warned about for JDK 1.5 Cheers, Brian -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2004-11-25 21:14 --- Another good patch. Committed. Many thanks. I think that it should be possible to simplify the code in the way you suggest (by using simple strong references) without effecting the function. My next priority will be to work on the documentation build and the user guide. Then push towards a 1.0.5 release. I'll leave this bug open until that's done in case you find time. Robert -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - [logging] Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 [EMAIL PROTECTED] changed: What|Removed |Added Summary|Memory leaks in JBoss due to|[logging] Memory leaks in |LogFactory cache|JBoss due to LogFactory ||cache -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 24286] - [el] Contention on global cache / parseExpression
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=24286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=24286 [EMAIL PROTECTED] changed: What|Removed |Added Summary|Contention on global cache /|[el] Contention on global |parseExpression |cache / parseExpression -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2004-11-22 23:52 --- Nice work. Committed. Many Thanks. I'm happy that this bug can be closed but I will leave it open for a while yet just in case Brian (or anyone else) wants to attach improvements. Robert -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2004-11-23 07:45 --- Created an attachment (id=13519) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=13519action=view) Javadoc for WeakHashtable Attached adds some class level Javadoc to WeakHashtable that tries to explain the classloading situation where a call to release() is still needed. There's some other stuff that I'd like to do on this (perhaps use simple strong references for values in WeakHashtable; refactor LogFactoryTest and LoadTest to avoid code duplication), but they don't affect the functionality, and it will probably be a while before a can get to them. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2004-11-19 06:27 --- Attaching some improvements to the LogFactoryTest. Designed to test different classloading configurations, particularly an isolated application classloader inside a container. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 --- Additional Comments From [EMAIL PROTECTED] 2004-11-19 06:33 --- Created an attachment (id=13498) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=13498action=view) Patch to LogFactoryTest -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-11 22:49 --- Contributions take different forms. I commonly rewrite or reimplement patches before applying them. (One of the signs I look for when nominating a new committer is that they start producing patches that I can apply without modification.) Without your contribution, this code wouldn't have been written. (I'm quick to credit but slow to nominate.) Just FYI I never add credit unilaterally (except in commit messages where it provides a record) so if you ever decide that you've done enough and would like your name added, submit a patch. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-11 23:03 --- Just to clarify: When Robert said if you ever decide you've done enough and would like your name added, submit a patch I believe he means provide a patch to the project.xml file which contains the author information :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-10 23:05 --- I've checked in my changes. I'm going to leave the documentation for another day. The idea is that the Hashtable implementation can be specified by a system property and (when the class is found on the classpath) defaults to the optional WeakHashtable. The idea is that a user (on a 1.3+ JVM) should be able to drop in the commons-logging-optional.jar and have the classloaders garbaged collectable without further changes. This is going to need some testing. I've added a few tests (if anyone wants to add more, please go ahead :) I'll probably post something on the lists tomorrow. BTW Brian, I'm happy to add your name to the contributors and/or author tags if that is your wish. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-11 06:51 --- I'll look this over as carefully as I can and try to add a few tests. I've got a couple thoughts, but I'll post to the commons-dev list to keep from filling up Bugzilla. Re adding my name, at this point you've done all the work :) If I'm able to make any further significant contributions to this, please feel free to add my name. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 08:49 --- Maybe something alongs these lines might work. There are major performance issues with using a reflection to hook up the methods but it might be possible to create a Hashtable implementation that uses a WeakHashMap internally and then try to load the class by name when the LogFactory class is initialized. If the class can't be loaded then a normal Hashtable would be used. Probably be a good idea to allow the class name to be specified in a system property. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 21:20 --- Yes, I think I made a likely unnecessary assumption that commons-logging has to compile under JDK 1.1, not just run. So I used reflection throughout. If compiling is not an issue, I would be happy to tweak WeakHashtable to get rid of all the internal use of reflection (and add the system property you suggested as well). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 22:06 --- I'm on GMT so the offer's come a little later (it's almost done) but the offer's really appreciated :) This kind of stuff benefits from many eyes so what would be really useful is if you could take a look at the code (once I've committed it, probably tomorrow now) and run any test cases you have against it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 22:08 --- Sure, no problem at all. I'll keep an eye out. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 22:39 --- The world is watching.. and waiting. Good to hear this is being address, in one way or another. Just FYI, commons-discovery attempts [impl. incomplete] to isolate JVM dependencies to a *.jdk package with a base interface JDKHooks and separate classes for JDK11Hooks, JDK12Hooks. We may not be able to support something in one version versus another, but at least this way we can document and isolate the dependencies. Even if it's as simple as a getWeakHashTable() function on one such. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 23:10 --- I agree with the sentiments but hopefully this solution is so simple that no discovery is needed :) One of the aims of the bytecode stuff I looking at is allow replacement of LogFactory with something that implements a minimal API. This might allow a commons-discovery based discovery mechanism to be added (by doping) without having to introduce a core dependency. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 07:01 --- I wrote something a couple weeks back that sounds like it might do something similar to what you were thinking about, but using reflection instead of bytecode manipulation. Basically, it detects if 1.2 is available and if so LogFactory uses a special Hashtable subclass that passes (almost) all calls through to a WeakHashMap. Almost, because to allow use in 1.1 JVMs the methods that include Collections framework classes in their signatures are not overridden. So, as you noted, this approach may cause issues with subclasses. I hesistated to submit this as it seems a bit of a hack, but, hey, why not Attached is a diff to LogFactory and a new class, WeakHashtable. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 07:02 --- Created an attachment (id=13360) WeakHashtable.java - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-09 07:03 --- Created an attachment (id=13361) LogFactory.diff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=31286. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31286 Memory leaks in JBoss due to LogFactory cache --- Additional Comments From [EMAIL PROTECTED] 2004-11-07 19:48 --- Had another look at this today and again it looks like the downsides of altering the code outweight the upside. I've been moving towards ideas about using bytecode manipulation to dope commons logging jars. The idea would be that though one-size-fits implementations are really not possible, it should be possible to use make small changes by altering the bytecode so that (for example) uses of the hashtable are replaced by calls to a WeakHashMap. The doped jar would no longer work correctly with certain subclasses or pre-Java2 JVMs but would release classloaders. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]