-
1. Re: JBCACHE-1153 - structural nodes
manik Oct 20, 2007 9:27 AM (in response to mircea.markus)Thinking a bit more about this since we spoke yesterday; I think this can become a problem since even a node with no data still has an overhead and an impact on memory. I think they should still be considered for eviction.
The whole purpose behind JBCACHE-1153 is so that certain nodes can be considered structural and not considered for eviction since they are just "path builders" rather than data buckets. Can't we just use the resident flag for this purpose instead?
See my comment on http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097183#4097183 about tombstones and invalid nodes. It shows how you could have empty nodes with no data, that *should* be considered for eviction. -
2. Re: JBCACHE-1153 - structural nodes
mircea.markus Oct 22, 2007 5:39 AM (in response to mircea.markus)I think this can become a problem since even a node with no data still has an overhead and an impact on memory. I think they should still be considered for eviction.
at the time the
If we consider for eviction such a node, and it gets to be evicted, nothing really happens at that point, unless it is a leaf node. For all non-leafs nodes, the eviction would only empty the attribute map, which in our case is already empty (effect of eviction would be void). I also agree that those nodes are not empty and somehow makes sense counting them as nodes to be evicted, but on the other hand they reduce the benefits of it which is cleaning up memory and allow for other data to be kept there...Can't we just use the resident flag for this purpose instead?
we can go on and implement based on this approach. The implementation is a bit trickier due to transactions:cache.put("/a/b/c","k","v"); //at this point "/a" and "/a/b" are structural + resident tx.start() cache.put("/a/b","k2","v2"); //at this point "/a/b" becomes not-structural tx.rollback(); //"/a/b" should not be structural + resident as transaction failed
See my comment on http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097183#4097183 about tombstones and invalid nodes. It shows how you could have empty nodes with no data, that *should* be considered for eviction.
I haven't totally get it (Mon morning :) ), let's have a chat -
3. Re: JBCACHE-1153 - structural nodes
manik Oct 22, 2007 7:12 AM (in response to mircea.markus)WRT transactions, I guess what I mean is, let's not automatically try and deduce whether a node is structural. I.e., let's make developers explicitly make a node resident instead. E.g.,
cache.put("/a/b/c", "k", "v"); cache.getRoot().getChild("/a").setResident(true); cache.getRoot().getChild("/a/b").setResident(true);
-
4. Re: JBCACHE-1153 - structural nodes
mircea.markus Oct 26, 2007 9:30 AM (in response to mircea.markus)I think this is a good approach also. After all the 'resident' flag gives te user enough flexibility.
-
5. Re: JBCACHE-1153 - structural nodes
manik Oct 29, 2007 11:47 AM (in response to mircea.markus)Shall we go with this then?
-
6. Re: JBCACHE-1153 - structural nodes
mircea.markus Oct 31, 2007 5:41 AM (in response to mircea.markus)yes, let's go with this one. I'll update the part of the manual that describes 'residency' adding this use case.