[jira] Created: (XMLBEANS-271) Path leaks objects in by caching paths and queries

View: New views
3 Messages — Rating Filter:   Alert me  

[jira] Created: (XMLBEANS-271) Path leaks objects in by caching paths and queries

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Path leaks objects in by caching paths and queries
--------------------------------------------------

         Key: XMLBEANS-271
         URL: http://issues.apache.org/jira/browse/XMLBEANS-271
     Project: XMLBeans
        Type: Bug

  Components: XPath  
    Versions: Version 1.0.3    
 Environment: WinXP, jdk 1.4.2_05
    Reporter: Scott L'Hommedieu


In org.apache.xmlbeans.impl.store.Path

Several HashMaps are used to cache paths and queries:


--
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: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Updated: (XMLBEANS-271) Path leaks objects in by caching paths and queries

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     [ http://issues.apache.org/jira/browse/XMLBEANS-271?page=all ]

Scott L'Hommedieu updated XMLBEANS-271:
---------------------------------------

    Description:
In org.apache.xmlbeans.impl.store.Path

Several HashMaps are used to cache paths and queries:

private static Map _xqrlPathCache = new HashMap();
private static Map _xbeanPathCache = new HashMap();
private static Map _xqrlQueryCache = new HashMap();

These caches are then used to store paths and queries as the queries are performed.
This cache is not managed so as the number of unique queries grows so does the cache.

Because the cache is not internally managed by xmlbeans the user should be allowed to set some limit to the cache size to prevent an over utilization of memory.

Below is a snippet of code to illustrate my idea of a sized cache.

private static HashMap _xqrlPathCache = new CacheMap();
private static HashMap _xbeanPathCache = new CacheMap();
private static HashMap _xqrlQueryCache = new CacheMap();
 
private static class CacheMap extends LinkedHashMap
{
    private static final String XPATH_CACHE_SIZE = "xpathCacheSize";
    private static int MAX_ENTRIES = -1;

    static{
        String size = null;
        if((size = System.getProperty(XPATH_CACHE_SIZE)) != null){
            try{
                MAX_ENTRIES = Integer.parseInt(size);
           }catch(Exception e)
            {   //There's no other logging in here otherwise I would spit out a message
            }
        }
    }


  was:
In org.apache.xmlbeans.impl.store.Path

Several HashMaps are used to cache paths and queries:



Oops, premature submit.

> Path leaks objects in by caching paths and queries
> --------------------------------------------------
>
>          Key: XMLBEANS-271
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-271
>      Project: XMLBeans
>         Type: Bug

>   Components: XPath
>     Versions: Version 1.0.3
>  Environment: WinXP, jdk 1.4.2_05
>     Reporter: Scott L'Hommedieu

>
> In org.apache.xmlbeans.impl.store.Path
> Several HashMaps are used to cache paths and queries:
> private static Map _xqrlPathCache = new HashMap();
> private static Map _xbeanPathCache = new HashMap();
> private static Map _xqrlQueryCache = new HashMap();
> These caches are then used to store paths and queries as the queries are performed.
> This cache is not managed so as the number of unique queries grows so does the cache.
> Because the cache is not internally managed by xmlbeans the user should be allowed to set some limit to the cache size to prevent an over utilization of memory.
> Below is a snippet of code to illustrate my idea of a sized cache.
> private static HashMap _xqrlPathCache = new CacheMap();
> private static HashMap _xbeanPathCache = new CacheMap();
> private static HashMap _xqrlQueryCache = new CacheMap();
>  
> private static class CacheMap extends LinkedHashMap
> {
>     private static final String XPATH_CACHE_SIZE = "xpathCacheSize";
>     private static int MAX_ENTRIES = -1;
>     static{
>         String size = null;
>         if((size = System.getProperty(XPATH_CACHE_SIZE)) != null){
>             try{
>                 MAX_ENTRIES = Integer.parseInt(size);
>            }catch(Exception e)
>             {   //There's no other logging in here otherwise I would spit out a message
>             }
>         }
>     }

--
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: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Assigned: (XMLBEANS-271) Path leaks objects in by caching paths and queries

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Wing Yew Poon reassigned XMLBEANS-271:
--------------------------------------

    Assignee: Wing Yew Poon

> Path leaks objects in by caching paths and queries
> --------------------------------------------------
>
>                 Key: XMLBEANS-271
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-271
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: XPath
>    Affects Versions: Version 1.0.3
>         Environment: WinXP, jdk 1.4.2_05
>            Reporter: Scott L'Hommedieu
>            Assignee: Wing Yew Poon
>
> In org.apache.xmlbeans.impl.store.Path
> Several HashMaps are used to cache paths and queries:
> private static Map _xqrlPathCache = new HashMap();
> private static Map _xbeanPathCache = new HashMap();
> private static Map _xqrlQueryCache = new HashMap();
> These caches are then used to store paths and queries as the queries are performed.
> This cache is not managed so as the number of unique queries grows so does the cache.
> Because the cache is not internally managed by xmlbeans the user should be allowed to set some limit to the cache size to prevent an over utilization of memory.
> Below is a snippet of code to illustrate my idea of a sized cache.
> private static HashMap _xqrlPathCache = new CacheMap();
> private static HashMap _xbeanPathCache = new CacheMap();
> private static HashMap _xqrlQueryCache = new CacheMap();
>  
> private static class CacheMap extends LinkedHashMap
> {
>     private static final String XPATH_CACHE_SIZE = "xpathCacheSize";
>     private static int MAX_ENTRIES = -1;
>     static{
>         String size = null;
>         if((size = System.getProperty(XPATH_CACHE_SIZE)) != null){
>             try{
>                 MAX_ENTRIES = Integer.parseInt(size);
>            }catch(Exception e)
>             {   //There's no other logging in here otherwise I would spit out a message
>             }
>         }
>     }

--
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: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...