{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/2925","labels_url":"https://api.github.com/repos/netty/netty/issues/2925/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/2925/comments","events_url":"https://api.github.com/repos/netty/netty/issues/2925/events","html_url":"https://github.com/netty/netty/issues/2925","id":43389397,"number":2925,"title":"NormalMemoryRegionCache's arraysize is over booked","user":{"login":"garretwu","id":841331,"avatar_url":"https://avatars.githubusercontent.com/u/841331?v=3","gravatar_id":"","url":"https://api.github.com/users/garretwu","html_url":"https://github.com/garretwu","followers_url":"https://api.github.com/users/garretwu/followers","following_url":"https://api.github.com/users/garretwu/following{/other_user}","gists_url":"https://api.github.com/users/garretwu/gists{/gist_id}","starred_url":"https://api.github.com/users/garretwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garretwu/subscriptions","organizations_url":"https://api.github.com/users/garretwu/orgs","repos_url":"https://api.github.com/users/garretwu/repos","events_url":"https://api.github.com/users/garretwu/events{/privacy}","received_events_url":"https://api.github.com/users/garretwu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/netty/netty/labels/defect","name":"defect","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/115","html_url":"https://github.com/netty/netty/milestones/4.0.28.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/115/labels","id":1050260,"number":115,"title":"4.0.28.Final","description":"","creator":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"open_issues":59,"closed_issues":8,"state":"open","created_at":"2015-04-02T12:45:12Z","updated_at":"2015-04-10T19:50:10Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2014-09-22T04:56:22Z","updated_at":"2015-04-10T22:02:18Z","closed_at":null,"body":"When create NormalMemoryRegionCache for PoolThreadCache. The array size is decided by:\r\n        int max = Math.min(area.chunkSize, maxCachedBufferCapacity);\r\n        int arraySize = Math.max(1, max / area.pageSize);\r\n\r\nSo most likely it is decided by maxCachedBufferCapacity/area.pageSize, with maxCachedBufferCapacity=2M the array size will be 2^8 = 256.\r\n\r\nwhen we try to get normal cache the index is pre-processed by log2():\r\nPoolThreadCache.cacheForNormal():\r\n        int idx = log2(normCapacity >> numShiftsNormalHeap);\r\n        return cache(normalHeapCaches, idx);\r\n\r\nA 2M cache entry will get from the 8th cache bin(start from 0).\r\n\r\nThe space for NormalMemoryRegionCache is over booked, though it will not impact correctness(just a little performance..)."},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/91704501","html_url":"https://github.com/netty/netty/issues/2925#issuecomment-91704501","issue_url":"https://api.github.com/repos/netty/netty/issues/2925","id":91704501,"user":{"login":"garretwu","id":841331,"avatar_url":"https://avatars.githubusercontent.com/u/841331?v=3","gravatar_id":"","url":"https://api.github.com/users/garretwu","html_url":"https://github.com/garretwu","followers_url":"https://api.github.com/users/garretwu/followers","following_url":"https://api.github.com/users/garretwu/following{/other_user}","gists_url":"https://api.github.com/users/garretwu/gists{/gist_id}","starred_url":"https://api.github.com/users/garretwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garretwu/subscriptions","organizations_url":"https://api.github.com/users/garretwu/orgs","repos_url":"https://api.github.com/users/garretwu/repos","events_url":"https://api.github.com/users/garretwu/events{/privacy}","received_events_url":"https://api.github.com/users/garretwu/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T22:02:18Z","updated_at":"2015-04-10T22:02:18Z","body":"sure, I could create a PR:)"}}