Hi Innka,
you don't get "Memory full" errors just by using global variables.
You get them because you
- build up arrays constantly
- open references without closing them
- similar wierd stuff…
So the point is: What kind of data do you store in those variables?
To share data you could use FGVs (FunctionalGlobalVariables aka ActionEngines aka LV2-style globals) or notifier or queues. It all depends on your requirements…