rivantsov / vita

VITA Application Framework
MIT License
59 stars 15 forks source link

Correct way to maintain sessions #214

Closed rubenalves closed 1 year ago

rubenalves commented 1 year ago

Hello,

I have a very large aplicattion and i create a main session for the aplication an create new ones for other tasks and treads that execute a small amount of code, is it possible to delete the session after it is not needed?

Every thing is working fine, but on slower machines the app starts give some erros after 3 or 4 hours. Thanks.

rivantsov commented 1 year ago

In general, you are not supposed to delete or close sessions, you just drop it, and it is garbage collected. I recommend not to keep session open for too long, and too recycle it. For your main session, it should be probably dropped/recreated regularly. But, I would not expect problems even if you keep your session for long. So it would be interesting to know, what errors are you seeing. Good that you noticed pattern that it happens on 'slower' machines, but it would be great to look at error messages if any, with stacks, or details on how 'failure' manifests itself. Do you also know memory/cpu usage numbers around fail time?

rubenalves commented 1 year ago

The errors usualy are not related with vita, so probably the sessions are not the problem, i will tell my users to by new hardware to not have problems :) . Thanks for your time.