You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/05/25 13:27:00 UTC
[jira] [Work logged] (ARTEMIS-3848) High cpu usage on ReadWrite locks
[ https://issues.apache.org/jira/browse/ARTEMIS-3848?focusedWorklogId=774556&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-774556 ]
ASF GitHub Bot logged work on ARTEMIS-3848:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 25/May/22 13:26
Start Date: 25/May/22 13:26
Worklog Time Spent: 10m
Work Description: clebertsuconic opened a new pull request, #4098:
URL: https://github.com/apache/activemq-artemis/pull/4098
This is caused by too many entires on the HashMap for ThreadLocals.
Also: I'm reviewing some readlock usage on the StorageManager to simplify things a little bit.
Issue Time Tracking
-------------------
Worklog Id: (was: 774556)
Remaining Estimate: 0h
Time Spent: 10m
> High cpu usage on ReadWrite locks
> ---------------------------------
>
> Key: ARTEMIS-3848
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3848
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.22.0
> Reporter: Clebert Suconic
> Assignee: Clebert Suconic
> Priority: Major
> Fix For: 2.23.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> our HandlerBase is setting a boolean value if it's in handler.
> I thought by setting it to null I was clearing the ThreadLocal variable, however that's just creating a null entry.
> What makes it worst is the fact that threadLocal was non static. as a result we are getting a lot of entries on the ThreadLocal HashMap. as connections come and go, that will generate a leak on the thread.
> That will cause threads on the following stack trace to consume a lot of CPU:
> at java.lang.ThreadLocal$ThreadLocalMap.expungeStaleEntry(ThreadLocal.java:638)
> at java.lang.ThreadLocal$ThreadLocalMap.remove(ThreadLocal.java:520)
> at java.lang.ThreadLocal$ThreadLocalMap.access$200(ThreadLocal.java:319)
> at java.lang.ThreadLocal.remove(ThreadLocal.java:242)
> at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:426)
> at java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1341)
> at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:881)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)