-incgcc would have spread out the GC work so you didn't get that huge stop-the-world pause. It looks like that isn't happening now so just keep it in mind if GC pauses return.
I've noticed that calling repaint is not as accurate as I need... sometimes the shape remains 2-3 pixels far from cursor when user stops dragging
This is something I have never seen. My first thought would be that there was a bug in your redraw code.
By using repaint() you might avoid a few paints because multiple repaint requests could be collapsed into a single one. This is specially true while the user is dragging the mouse and generating a lot of repaints.
Does the sleep cause the mouse motion to be less smooth or lagged?
You could do something else to put a cap on how often repaint is called so that drawing doesn't hog the CPU from your other operations. Use a timer maybe to trigger repaints, stop the timer if there hasn't been any changes to the shapes since the last repaint.
Have you profiled the code?
-Xprof
Can you upgrade to 1.4.2?
Getting rid of many temporary objects like Point and Rectangle is good in general, in terms of GC. You might also choose to reuse objects of this type, particularly with APIs that give you the option of supplying a Point to be filled in as opposed to needing to create a new one to return the data.
With
buffer being Volatile you should be careful about the rendering hints you use.. anti-aliasing might cause reads from the video memory which are very slow, it could be better to not try accelerating this image, depending on how it is used.