modelmapper / modelmapper

Intelligent object mapping
http://modelmapper.org
Apache License 2.0
2.29k stars 350 forks source link

Thread Blocked TypeMapImpl.java 121 #544

Open clickrajnish opened 4 years ago

clickrajnish commented 4 years ago

TypeMapImpl.java:121 MappingEngineImpl.java 151 ..... .... ModelMapper.java;573 ModelMapper.java:406

Above is java stack trace ... Thread is blocked Version:2.3.5

chhsiao90 commented 3 years ago

Can you provide more information?

malteo commented 3 years ago

it seems I have the same issue with modelmapper version 2.4.4

"qtp58488213-29@3485" prio=5 tid=0x1d nid=NA waiting for monitor entry
  java.lang.Thread.State: BLOCKED
     waiting for ForkJoinPool.commonPool-worker-19@17976 to release lock on <0x5560> (a java.lang.Object)
      at org.modelmapper.internal.TypeMapStore.getOrCreate(TypeMapStore.java:122)
      at org.modelmapper.internal.TypeMapStore.getOrCreate(TypeMapStore.java:106)
      at org.modelmapper.internal.MappingEngineImpl.map(MappingEngineImpl.java:112)
      at org.modelmapper.internal.MappingEngineImpl.map(MappingEngineImpl.java:71)
      at org.modelmapper.ModelMapper.mapInternal(ModelMapper.java:573)
      at org.modelmapper.ModelMapper.map(ModelMapper.java:406)
      at com.liberologico.cloudesire.cmw.services.impl.BeanMapperServiceImpl.copyProperties(BeanMapperServiceImpl.java:75)

it happens only on JDK>=15 (we are trying an upgrade), works correctly with JDK11

I think it has something to do with implicit mapping, it doesn't block when I disable it

chhsiao90 commented 3 years ago

Hi @malteo -

Can you provide more information? When I thread was blocked, there might be another thread which was running and holding the lock. Thanks.

And maybe some source. code is helpful.

malteo commented 3 years ago

it doesn't happen with JDK 17 ¯\(ツ)

chrismoos commented 2 years ago

I see the same issue on Apple M1, using JDK 17. If I switch to Zulu Java 11 JDK this issue doesn't happen.

WatchdataGitHub commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。