java map 高并发_java的hashmap高并发问题

41528d3028836879cd698677c3999917.gifjava的hashmap高并发问题

java 的 HashMap 高并发问题2010 年 1 月 9 日 114 views 评论 发表评论 今天不知为什么服务器卡死了把所有线程的堆栈打印出来是这样的java.util.HashMap.get……………….ReceiveWorker.runjava.util.concurrent.ThreadPoolcutor$Worker.runTaskjava.util.concurrent.ThreadPoolcutor$Worker.runjava.lang.Thread.run所有线程都是卡死在这里了后来也想不出为什么就用 ConcurrentHashMap 代替了突然在 ibm 上发现一编文章是这写的JR33299: 6.2.0.1: java.util.HashMap.get() causes high CPU use after migrationDownloadable filesAbstractAfter migration of a WebSphere InterChange Server repository and deployment of the migrated artifacts to WebSphere Process Server, the migrated content causes high CPU use.Download DescriptionJR33299 resolves the following problem:ERROR DESCRIPTION:After migration of a WebSphere InterChange Server repository and deployment of the migrated artifacts to WebSphere Process Server, the migrated content causes high CPU use when calling the BusObj API. The thread dump shows that many threads are waiting, which causes a degradation in perance:at java.util.HashMap.get(HashMap.java:346)at CxCommon.BusinessObject.(BusinessObject.java:277)at Collaboration.BusObj.(BusObj.java:94)Using ConcurrentHashMap instead of HashMap can bypass this Java problem.LOCAL FIX:You can possibly avoid this problem by reducing the concurrency of the system.USERS AFFECTED:WebSphere Process Server v6.2.0.1 users who migrate a WebSphere InterChange Server repository.PROBLEM DESCRIPTION:After migration of a WebSphere InterChange Server repository and deployment of the migrated artifacts to WebSphere Process Server, high CPU is seen in java.util.HashMap.get(), which is called by an early version of the BusObj API.RECOMMENDATION:NonePROBLEM SUMMARY:java.util.HashMap is not thread-safe and can cause high CPU use when HashMap is used in a concurrent setting with insufficient synchronization.PROBLEM CONCLUSION:Applying this interim fix resolves the problem. The fix for this APAR is targeted for inclusion in a future v6.2.0 fix pack.好明显,ibm 的 websphere 也遇到这个问题,后来也是把 hashMap 换成ConcurrentHashMap 解决的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值