I use a Inspiron N4050 with an intel core i5 gen 2, the gpu is a Intel HD graphics and i also have 4 gb of ram. Is there anything else i should tell you?
Yes, why do you not upgrade that dinosaur?
Even if you want to stay on a Laptop, entry level Laptops will offer you already much more performance than that old thing. (just make sure it has an SSD and 16GB RAM)
4GB RAM is nothing, Windows 10 takes 2GB of it, Intel Graphics and the game the rest and even more, meaning the rest of RAM will be put on your Laptops HDD, where you also try to record the footage onto at the same time.
Your only hope would be using QuickSync on OBS if that Intel Chip has that, but still, the 4GB RAM will be full and you'll get the exact same issue regardless.