{"action":"closed","issue":{"url":"https://api.github.com/repos/springside/springside4/issues/47","labels_url":"https://api.github.com/repos/springside/springside4/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/springside/springside4/issues/47/comments","events_url":"https://api.github.com/repos/springside/springside4/issues/47/events","html_url":"https://github.com/springside/springside4/issues/47","id":4441870,"number":47,"title":"关于ehcache的几个反馈","user":{"login":"javatester","id":1710165,"avatar_url":"https://avatars.githubusercontent.com/u/1710165?v=3","gravatar_id":"","url":"https://api.github.com/users/javatester","html_url":"https://github.com/javatester","followers_url":"https://api.github.com/users/javatester/followers","following_url":"https://api.github.com/users/javatester/following{/other_user}","gists_url":"https://api.github.com/users/javatester/gists{/gist_id}","starred_url":"https://api.github.com/users/javatester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javatester/subscriptions","organizations_url":"https://api.github.com/users/javatester/orgs","repos_url":"https://api.github.com/users/javatester/repos","events_url":"https://api.github.com/users/javatester/events{/privacy}","received_events_url":"https://api.github.com/users/javatester/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2012-05-06T08:30:48Z","updated_at":"2015-11-07T03:11:59Z","closed_at":"2015-11-07T03:11:59Z","body":"针对ehcache的几个配置参数做了下 测试 ,发现实际结果与官方文档说明不一致,希望白衣大侠能指点下原因\r\n(环境 , ehcache 版本为 2.5.2 ,  基于 springside的   EhcacheDemo 进行的测试)\r\n1. 修改配置 maxEntriesLocalHeap=\"10000\" , overflowToDisk=\"true\"  ,  在 EhcacheDemo 中 添加以下循环 插入数据: \r\n        for (int i=0;i<1000;i++) {\r\n            put(i + \"\" , \"value:\" + i);\r\n        }\r\n插入数量仅为 1000条 ,  而阀值设置的为 10000 ,结果发现此种情况下, ehcache会往硬盘中写入缓存数据 , demoCache的硬盘文件容量不为0 .\r\n2.修改 maxBytesLocalHeap=\"100M\"  , overflowToDisk=\"true\"  , 同样在 EhcacheDemo 中 添加以下循环 插入数据: \r\n        for (int i=0;i<1000;i++) {\r\n            put(i + \"\" , \"value:\" + i);\r\n        }\r\n插入数量为1000条, 实际 内存中占用应该很小,但是发现  , 此时 ehcache 仍然会往硬盘中写入缓存数据  ,demoCache的硬盘文件容量不为0 .\r\n\r\n通过测试发现 ,只要 overflowToDisk 设置为 true , ehcache 不管 maxEntriesLocalHeap 和  maxBytesLocalHeap的 阀值设置 多少,始终会 往硬盘中写入数据 ,这与 官方文档的描述 不一致. (官方文档地址: http://ehcache.org/documentation/configuration/cache-size)\r\n希望白衣大侠能够 指点下 这个原因 ,是否为 ehcache 新版本的 bug "}}