it47878 :
I also think of that it is by heating but recently I found out that if I unplug power adapter it works normal. so still can it be a problem of heating or would it be a problem of charging unit? can it be fix after cleaning fan?
Usually the gpu/cpu will downclock to the lowest settings on battery to save power unless you override it in the power settings, so when you unplug the adapter, everything downclocks, doesn't run as fast, less heat, no problem. Plug into power, cpu/gpu ramp up, heat builds up, graphics show up.
Either it's the fan clogged up, or thermal paste gone and the extra heat when it's plugged in is causing the artifacts or the gpu is dying (which is common in a few year old laptops) and when it heats up at all, it starts to act up and thermal paste/fan may or may not help.
I like Brent, fix PC's/laptops and everything else, my specialty being 360's and PS3's and reflowing and reballing them because of the red ring/yellow light problems on those consoles. Sometimes, after reflowing, additional cooling, etc, the GPU is still too damaged and any heat add's too much stress and they get colors/artifacts and at that point, it's install a new GPU via reball or trash the system.
It could just be getting too hot and after 3 years, most laptops need a good cleaning and new thermal paste. Most people don't care of their laptops, use them as a desktop so they are on 24/7, they use them on couches, blankets, etc that add's dust and blocks cooling vents and they overheat. Sometimes though, the GPU is damaged and beyond repair without removing the GPU and reballing a new gpu in place, which is a tedious expensive process that I don't usually do on a laptop unless it's a very expensive, newer laptop that people are willing to spend money on, regardless if I can fix it or not. I'm not buying a new GPU unless you're paying for it regardless.