1

Mojarra 2.3.0-m01-SNAPSHOT, MyFaces Extensions CDI Bundle 1.0.6, Glassfish 4.0, ObjectDB.

I have a RequestScoped CDI bean. When I first time come to a page that uses this bean, a new instance appears in the heap (I watch using VisualVM) and isn't removed later, but its @PreDestroy is being called. When I come second time without cleaning cookies, it creates another instance of the bean that is being cleaned in several seconds.

But when I clean the cookies and come to the page again, it creates the second unremovable bean instance. So after ~4000 new users the heap contains about 500 MB of useless objects and site is being down with out of memory error. Why does not GC clean some RequestScoped beans? They should be active during the requests processing and removed after it. Here is the references of one of this beans:

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Vladiator
  • 326
  • 1
  • 3
  • 17
  • GF 4.0 is old and buggy. Have you tried latest? And if in vain, tried upgrading Weld in it, if newer available? – BalusC Mar 09 '15 at 08:21
  • Upgraded to 4.1: can't login using web console (error 500 on j_security_check), asadmin and JMX, so I cannot confidently tell if the error still exist – Vladiator Mar 09 '15 at 21:13
  • I am seeing something similar with GF4.1.1 and Payara-4.1, am preparing a new test case to illustrate it. BTW, for a long time I [got misleading results using JVisualVM](http://stackoverflow.com/questions/40569971/jsf-mojarra-vs-omnifaces-viewscoped-predestroy-called-but-bean-cant-be-gar), it was hanging on to references strangely, I got more consistent results with the NetBeans Profiler run inplace. – Webel IT Australia - upvoter Jan 14 '18 at 04:26

0 Answers0