Check the 'Memory:' and 'JVM Flags:' lines under System Details in your crash report to see your current RAM cap, and verify how much physical RAM your computer has so you keep at least 2–4 GB free for your operating system.
Increase the RAM allocation in your launcher settings: set the memory slider to 4096–6144 MB (4–6 GB) for medium modpacks, or 6144–8192 MB (6–8 GB) for large packs with 150+ mods (in the vanilla launcher's JVM Arguments, change -Xmx2G or -Xmx3G to -Xmx6G).
Verify in the crash report that 'Java VM Version' says '64-Bit Server VM'; if it says 32-bit, install 64-bit Java and point your launcher to it so Minecraft can use more than 1.5 GB of RAM.
If your PC lacks enough physical RAM to increase the limit, close heavy background apps like web browsers, lower your mipmap levels to 0 in options.txt, or add a memory-saving mod such as FerriteCore (modern versions) or VintageFix/FoamFix (1.12.2).