I beg pardon for the english skills in advance.
For some reasons, i've realized everything in this way (essentially due to a java practical experience lack and ignorance of multithreading). This code works more or less what i've expected it should do, but it's turned out it has high cpu usage (after some changes made it's ranging from 30% to 70% now) and noticeable memory leaks (when it starts to occupy about 2 Gb of RAM everything is gradually getting bad for GUI and PC as well). I've already done everything i could to try to fix it.
I would be glad to hear any tips and what i could do in this situation (even if those are Java general tips).
/code is removed because of reducing originality of diploma/
I would like to reduce CPU usage at least to an acceptable level and what much more important i wanna get rid of the memory leaks mentioned above.