I see people having trouble with getting forge and optifine to work together, and all of the tutorials with different methods are either easy or complex, and it justs confusing. I got mine to work perfectly.
This DOES work with shaders, as I use them myself. It's compatible with any mod really, due to the way it's installed. So if it says not compatible with Forge and Optifine, that's wrong, because it does work.
Next, install Optifine to the Forge .jar file, remember to delete the META-INF
Once you have done that, go into your launcher, and create a new profile using the version mentioned earlier. (1.6.4_Forge)
Click Edit Profile, and check: JVM Arguments
It's on the very bottom of the window, above Cancel.
Because I run shaders and have 8GB of RAM on the second PC. (16GB on the first one, me and my little brother play LAN, our .minecraft folder is linked to a network drive so we both run the same .minecraft)
I submitted this because I can, really, if it helps anyone who has any issues with crashes using Optifine and Forge.
Also I think you have to use this method to get shaders on minecraft, due to the mods folder loading the mods in the incorrect order. (Just incompatibility issues when in wrong order.)
This method fixes that by loading Forge and Optifine FIRST, and then all the other mods.
So this should fix any compatibility issues with mods.