question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutoUpdate: Memory Leak

See original GitHub issue

HISTORY

We recently updated an application from PF 6.1 to 6.2.20. Our application won’t stay alive for more the 24 hours without going into a GC death spiral and running out of memory.

We have narrowed the leak down to leaking copies of javax.faces.component.StateHolderSaver

1) Environment

  • PrimeFaces version: 6.2.20
  • Does it work on the newest released PrimeFaces version? NO on 7.0.3
  • Does it work on the newest sources in GitHub? NO on 7.1.1-SNAPSHOT
  • Application server + version: Mojarra 2.2/2.3, Jboss EAP 7.1
  • Affected browsers: ALL

2) Steps to reproduce

Attached is a sample runner: pf-memleak.zip

Run the application and navigate to http://localhost:8080/primefaces-test/test.xhtml and just leave the page running.

Run JVisualVM and just monitor javax.faces.component.StateHolderSaver you will see the instances climb. If you press “Perform GC” you will see the instances go down but then come back extremely fast as they all get re-instantiated. It will also garbage collect but start at a higher number each time like instances are being held onto to. After 24 hours and 1000’s of users we eventually run out of all resources.

If you open 2 or 3 different browsers on your machine you will see the problem happen even faster and more aggressively.

5) Sample XHTML

	<h:form id="frmTest">
		<p:messages id="globalMessages">
			<p:autoUpdate />
		</p:messages>
		<p:poll id="pllTest" interval="1" listener="#{basicController.controllerMethod()}" update="txtTest " />
		<h:outputText id="txtTest" value="#{basicForm.value}" />
	</h:form>

6) Visual VM

image

7) Analysis

  • If you use Mojarra 2.2. or 2.3 we see the leak. Using MyFaces 2.2 and 2.3 it doesn’t appear to happen but it looks like MyFaces uses different classes.
  • If we remove the <p:autoUpdate> and have the poller just do update=“” our app no longer leaks these javax.faces.component.StateHolderSaver.
  • If you do “Perform GC” over and over you will see each time the StateHolderSaver garbage collect but each time they garbage collect but start at a higher number each time. Because we have say 1000-2000 users all on this page all day you can see how it can leak and not survive for more than 24 hours.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:33 (31 by maintainers)

github_iconTop GitHub Comments

1reaction
tandraschkocommented, Jun 11, 2019

the listener will be replaced only with jetty:run-exploded, therefore jetty:run won’t work out of the box

1reaction
cnsgithubcommented, Jun 11, 2019

I just removed this from web.xml:

    <listener>
        <listener-class>${jsf-listener}</listener-class>
    </listener>

Then jetty:run is working with YJP profiling from within IntelliJ.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KB2778088 - FIX: Memory leak if you enable the ...
Fixes a memory leak that occurs when the queries are compiled. This issue occurs after you enable the AUTO_UPDATE_STATISTICS_ASYNC statistics option in SQL ......
Read more >
Memory usage increases after each IPS automatic update
Each time IPS performs an automatic update (default: every two hours), FWD's memory usage increases. The memory_monitor tool (used to map ...
Read more >
AutoUpdate from AJAX, Memory leak/slowdown? - Highcharts
Hi All, I'm running into an issue when pulling data from an AJAX service. The request returns a javascript array of data points...
Read more >
Cisco Bug - Memory Leak due to IPS Auto Update process
Symptom: Memory Leak observed on 2911 due to IPS Auto Update process Conditions: IOS Software upgrade to 15.2 code train, configuration of ...
Read more >
dwm.exe (Desktop Window Manager) Produces a Memory ...
dwm.exe produces memory leak with 6th Generation Intel® processors through 10th Generation Intel® processors. The dwm.exe memory usage starts low (~30MB), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found