|Re: Multithreading characteristics of MAT API [message #1450342 is a reply to message #1434969]
||Wed, 22 October 2014 10:49
| Andrew Johnson
Registered: July 2009
I don't think we have done a lot of work making MAT thread safe, other than not wanting problems to occur when analyzing multiple dumps from the UI.|
I'd like it to be safe, but it may require some code review and changes.
Separate snapshots should be independent - though it looks like the loading could do with some protection.
The snapshot itself is fairly static, but with some caching of fields or class objects. The index API linking objects IDs to addresses, outbound references, inbound references does have caching too. I can't remember if these were properly synchronized.
There is a little multithreading inside of MAT - for things like object marking for finding which objects are reachable from others. There has been a request to make parsing multi-threaded, but that could be difficult as a lot of the time is spent reading the snapshot dump file. Also, I don't know whether the IBM DTFJ readers are thread safe, so we could have to lock on those. I'd expect them to be safe across different dumps.
As many machines now have multiple threads/cores we should improve this aspect of MAT. Dario, perhaps you could look to find some other suspicious areas.
Powered by FUDForum
. Page generated in 0.02092 seconds