Insights into Java Server Faces


Reduced session size with empty Maps/Lists taking zero bytes space allocation

Filed under: Java, JSF — Hanspeter @ 23:03

It’s quite a while since my last post and this one is related to JSF but not only, it might also be usefull for other use cases. I will show a way to not allocate any space for empty collections (mainly Lists/Maps) unless a first entry is added – and that in a way that is fully transparent for the using part of the Map/List. This helps to keep managed beans containing data as small as possible and therefore allows to reduce session size. (more…)


Blog at