ig-memtrace icon indicating copy to clipboard operation
ig-memtrace copied to clipboard

exception around BeginReceive() / trace recording performance improvement / updated to VS2019

Open gjaegy opened this issue 5 years ago • 3 comments

gjaegy avatar Feb 06 '20 14:02 gjaegy

I've managed to create a pull request with all our local changes so far. Beside the two changes I've mentioned in the "Issues" posts, I've also included some modifications for VS2019 and x64.

gjaegy avatar Feb 06 '20 15:02 gjaegy

Actually, the exception I had (handled 7ff39ed) was due to the socket send buffer not large enough to handle all the MemTrace::HeapFree() calls occuring when our application closes (we have a custom allocator and all allocated pages are released at that point). I've increased the socket buffer size to 4MB, which works for us, it might be a good idea to make that configurable by the user. [edit] A cleaner fix could actually consist in not calling closesocket() as soon as the call to send() struggles to send the entire buffer, but rather call send() multiple times with the unsent portion of the data until all data has been sent (with a Sleep() call in the loop). This would slow down the application but will ensure received data integrity on the GUI tool side. Actually I would both increase the buffer size and fix the send()/closesocket() combo.

gjaegy avatar Feb 06 '20 16:02 gjaegy

I've made some further changes, memtrace is now working as expected with our application. You might want to simply merge all my changes (please check first :))

gjaegy avatar Feb 07 '20 15:02 gjaegy