concurent access to HashMap

53 views
Skip to first unread message

Юрий Михеев

unread,
Aug 3, 2017, 5:09:15 AM8/3/17
to MapDB

I try reading and writing to HTreeMap from 5 threads And have 75% CPU time locked is it normal? How can I resolve it?


Jan Kotek

unread,
Aug 3, 2017, 9:20:41 AM8/3/17
to ma...@googlegroups.com
This has been fixed in 3.0.5, there was performance issue

--
You received this message because you are subscribed to the Google Groups "MapDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapdb+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Юрий Михеев

unread,
Aug 3, 2017, 12:30:36 PM8/3/17
to MapDB
Jan, thank for you work and the answer, I checked the version I have. It is 3.1.0-SHAPSHOT

Jan Kotek

unread,
Aug 3, 2017, 1:01:15 PM8/3/17
to ma...@googlegroups.com
In that case switch to older version, snapshot may not have this fix

Юрий Михеев

unread,
Aug 3, 2017, 2:40:29 PM8/3/17
to MapDB
I did it. Now 72% CPU time is spent on org.mapdb.HTreeMap.get
in a case of only one thread org.mapdb.HTreeMap.get used 2,3% CPU time.
in fact, I think the lock  is in version 3.0.5 too

Юрий Михеев

unread,
Aug 3, 2017, 4:33:53 PM8/3/17
to MapDB
I realized the reason is my data structure. I have a small set of keys which occur too often. So getting and setting values blocks each other. 
Reply all
Reply to author
Forward
0 new messages