I have this issue when playing Minecraft. Longer I play, the more lag spikes I get. Most of these lag spikes come from chunk upload and memory garbage collection. My CPU is Intel Pentium 4000 and GPU Intel HD 505. 4 GB of RAM and storage is 1 TB HDD. Laptop is Asus XN547 (I think, writing this thread in rush). Minecraft 1.16.5 with Optifine. 2 GB of memory for Minecraft. Render distance 6 chunks. Ask in comments for more details (video settings, resource packs I use etc.