I finally found out why my laptop emits annoying high pitched noise. Recently I am using the laptop's external VGA port for displaying my screen, if I run everything on my native screen, it's very quiet even when the CPU is at full speed. Maybe this is just happening in my laptop.