yeah, i think you might be right about RAM. Because one day i was holding my latop in my one hand and i saw this screen flickering thing. that was the first time this issue happened. And yeah i can not login to tty when the freeze happens this mean system is completely blocked and is not a graphical problem. I dont think its OOM issue as i have enough RAM and no system doesnt slow down a couple of seconds before freezing entirely. The freeze is random and instant and it happens sometimes when i slide laptop so i think its due to RAM loose connection. Not sure if the RAM is soldered one or is detachable. I will try to replug it and see if it fixes the problem. btw the machine in question is macbook pro 2012 and thanks for replying kind stranger!