[jboss-jira] [JBoss JIRA] (LOGMGR-143) NullPointer in JbossAppenderHandler.doPublish() degrades performance
James Perkins (JIRA)
issues at jboss.org
Mon Nov 7 11:31:00 EST 2016
[ https://issues.jboss.org/browse/LOGMGR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13318314#comment-13318314 ]
James Perkins commented on LOGMGR-143:
--------------------------------------
Something must be adding a {{null}} appender. We should probably just guard against {{null}} from being added to the list.
> NullPointer in JbossAppenderHandler.doPublish() degrades performance
> --------------------------------------------------------------------
>
> Key: LOGMGR-143
> URL: https://issues.jboss.org/browse/LOGMGR-143
> Project: JBoss Log Manager
> Issue Type: Bug
> Components: core
> Affects Versions: 1.1.0.GA
> Environment: Windows 7 x64
> WildFly 8
> Java 8.0_102
> Reporter: David Frank
>
> I don't have code I can send to reproduce this, but if the issue doesn't show up readily, I can try to create it.
> I noticed while doing some performance monitoring of WildFly with JVisualVM, that JBossAppenderHandler.doPublish() kept popping up in the top 5 for Self Time (CPU). This is the method:
> {code:java}
> 36 @Override
> 37 protected void More ...doPublish(final ExtLogRecord record) {
> 38 final LoggingEvent event = new LoggingEvent(record, JBossLogManagerFacade.getLogger(logger));
> 39 final List<Appender> appenders = getAppenderList(logger);
> 40 for (Appender appender : appenders) {
> 41 if (new JBossFilterWrapper(appender.getFilter(), true).isLoggable(record)) {
> 42 appender.doAppend(event);
> 43 }
> 44 }
> 45 }
> {code}
> After attaching the Eclipse debugger to it, I found the following:
> 1) The logger's name was ""
> 2) The appender list returend from getAppendersList(logger) had one element in it, and it was null. So the for loop following it would throw the null pointer.
> I put a quick hack in place to see how much of an impact this was having, basically putting a if(appender != null) check within the for loop. My average CPU load for WildFly dropped from about 173% to 130%.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list