1

this is not a question... I'm sorry if that is against the rules but I find that google rates this site very high and for me this info would have helped a lot. If it is not acceptable we could delete this message and the 'harm' stays limited.

I switched from MyFaces-2.0.10 with RichFaces-3.3.3 to MyFaces-2.1.6 with RichFaces-4.2-Final and the memory usage of our application dropped enormously. From a staggering 50MB+ per session to almost none. We used to consume at least 1GB for every 20 users and that dropped to less then 200MB for any amount of users (<50 tested). Another effect is that it all seems faster, but we did not benchmark that.

It was a lot of work to migrate and it took two programmers about 4 months (total 30 hours/week) to learn the new ways and get it implemented. But that obviously will depend on the size of the project. We had to cope with a lot of bugs/issues in RF and MyFaces that are now fixed. I think that I could do it in a third of the time with what I know now. BalusC would do it in a week :)

So my advise is that if you have memory issues it might be an idea to start upgrading. It has to be done someday so why not now?

MAG, Milo

Milo van der Zee
  • 1,031
  • 11
  • 30
  • 1
    A question could be, why did your app need 50MB _per session_? – Matt Handy Mar 29 '12 at 10:39
  • We have been debugging that for about three years and came not further that that it was in the session and not in our app. When the session was destroyed the memory was released again. And, the session would increase over time. At first login it would only take a couple a kB but after a day of working in the app it was increased a lot. Clicking through the application did not trigger the memory usage increase iether. It really needed the time somehow. – Milo van der Zee Mar 29 '12 at 17:17
  • The memory usage did not change between server or client side state saving... – Milo van der Zee Mar 29 '12 at 17:32

2 Answers2

1

It is great people has started to notice the big improvements done in MyFaces Core 2.1.6. Really a lot of cool tricks has been done, but only in 2.1.6 the lastest lines were added, and the final effect is a big improvement in memory usage / code speed / session size. MyFaces Core 2.1.7 will contain another bunch of improvements too, so stay tuned following MyFaces Team Twitter

lu4242
  • 2,318
  • 1
  • 15
  • 15
0

The state saving has been improved since JSF 2.0. "Partial State Saving" was introduced which enables saving the state of only the relevant components (UIForm, UIInput, etc) instead of the entire component tree (UIViewRoot). As the view state is by default saved in server side session, this will indeed drop the memory usage, for sure if you have relatively large views.

While RichFaces 3.3.x, which is designed for JSF 1.x, works on JSF 2.0 (with some hacks), it didn't utilize the new JSF 2.0 partial state saving at all. RichFaces 4.x, which is is designed for JSF 2.x, supports it, so you would surely see a drop in memory usage when done right.

To improve it further, you could consider setting the state saving method to client with only a minimum of network bandwidth increase. This way the memory usage will be further reduced and any potential ViewExpiredException would be eliminiated.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555