First of all, it depends on how big and busy your forum is. If you are just starting out and only have a few posts I guess 4GB is enough.
A large forum can benefit from more memory. One of the rules of thumb is to use the size of your database as a reference. Performance-wise you should give MySQL the same or more memory compared to its size. So if your DB is let's say 8gb in size, give MySQL 8-12GB of memory. If you tune MySLQ correctly, the whole DB can be loaded in memory which should give you a performance boost.