I use Tdictionary taking over 4GB heap for dynamic variables. My computer has only 4GB RAM. I suppose Windows will put the variables on virtual memory. Do you have any experience as to how significant will be downturn of running time? Will I need a computer with more RAM? I may need from 8GB to 64GB RAM to be used for dynamic variables in my application.
This depends on your access pattern. It can range from nearly transparent to very, very bad.
Afaik TDictionary is not the most memory conserving structure, and hashes distribute their structures randomly in memory. So even if there is a pattern ( e.g. when you access an item, the typically the next item is near in time or place or some other factor), the hash will distribute them pseudo randomly in memory.
The more logical way then would be to create an index that puts items that are near in such factor close together. That will improve swapping performance.
In general, a rule of thumb is that virtual memory doesn't work very well with (total used memory)/(physical memory) > 2.
Anyway, I think it will require a lot of rethinking, and it is wiser to just plug in more memory in most cases. 64GB is expensive, but still doable. If you are on a budget, a bunch of old machines with 8GB in a cluster configuration might be cheaper. (but more work, since you need to adjust your software for that)