Synchronize is used when you want to create your methods thread protected. The disadvantage of synchronise is it would end up in slow down the program. And if it will not be handled properly it can end up in dead lock.
1. Only use synchronization when writing multithreaded code as there is a speed cost associated with its use.
2. In case of synchronized method modifier, the byte code generated is similar as non-synchronized method. The only difference is that a flag called ACC_SYNCRONIZED property flag in method''s method_info structure is set if the synchronized method modifier is present.
3. Also, synchronized keyword can create the code larger in size if used in the body of the method as byte code for monitor enter or monitor exit is generated in addition to any exception handling.