Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-10803

MemoryLeak in AntPathMatcher during caching AntPathStringMatcher instances

    XMLWordPrintable

    Details

    • Last commented by a User:
      true

      Description

      Implementation matchStrings:

      	private boolean matchStrings(String pattern, String str, Map<String, String> uriTemplateVariables) {
      		AntPathStringMatcher matcher = this.stringMatcherCache.get(pattern);
      		if (matcher == null) {
      			matcher = new AntPathStringMatcher(pattern);
      			this.stringMatcherCache.put(pattern, matcher);
      		}
      		return matcher.matchStrings(str, uriTemplateVariables);
      	}
      

      is adding unlimited number of AntPathStringMatcher to "cache".

      In applications with SEO friendly addresses with lots of combinations of parameters causes a problem with the heap memory, every url pattern are stored in cache.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              pboburk Pawel Bobruk
              Last updater:
              Spring Issuemaster
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 30 weeks, 3 days ago