In general the best place to allocate RAM is in your constructor, and the free in your detructor. However, sometimes you will need to know the max. block size, so you might want to (re)allocate in Reset(). You should try really hard to prevent allocations in ProcessDoubleReplacing(), as this could result in audio dropouts.
Now, most RAM usage will likely come from your GUI (image resources). If so, then your constuctor will indeed not free them, because they are static (i.e shared among instances).
That being said, REAPER has the option to fully unload VST plug-ins, which does free shared memory after the last instance is removed. However, I don't know if this also applies to VST3.
|