You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2020/10/05 18:02:32 UTC

[GitHub] [tomcat] markt-asf commented on pull request #368: fix: CachedResource add path length

markt-asf commented on pull request #368:
URL: https://github.com/apache/tomcat/pull/368#issuecomment-703794569


   I've done some calculations and the absolute upper limit (the actual upper limit will be lower) is that a cache with a 10MB limit on size will actually use a little under 175MB. That isn't great but it isn't terrible either. I'll tweak the resource size calculation so it includes an approximate of the memory required to store the path.
   The proposed patch has a couple of issues:
   
   - It converts the string to bytes to determine the size.  This is both expensive and wrong. String length *2 +38 is a much closer approximation and I intend to ignore the 38 as that is already accounted for in the 500 byte overhead for each entry.
   - It includes the path size when determining if the resource exceeds the max object size (and hence won't have the content cached) but does not include the path size when performing the same check to determine when deciding whether to cache the content or not.
   
   I should have a fix for this committed shortly.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org