Newbie question - variables and memory

B

Ben V.

I may be wrong, but I might have read somewhere that there's a need to
delete variables from memory. In my web environment, can the same
variable or instance (@) variable retain the same value across multiple
requests, or was that about something else? (I know about session and
fom variables, and flashes, but I'm talking about regular variables or
instance variables) Thanks for your help and time.
 
H

hanumizzle

Ben said:
I may be wrong, but I might have read somewhere that there's a need to
delete variables from memory.

In normal usage, no. Ruby supports garbage collection, meaning that
memory allocated for objects no longer reachable will be reclaimed.
In my web environment, can the same
variable or instance (@) variable retain the same value across multiple
requests, or was that about something else? (I know about session and
fom variables, and flashes, but I'm talking about regular variables or
instance variables)

You are talking about two very different things. Here, I think you're
digressing into CGI. And in that case, you should see the Sessions
section of this article: http://www.rubycentral.com/articles/cgi.html

Management of CGI session data is wholly distinct from Ruby's
management of objects in general. Ruby the language knows nothing about
CGI, CGI sessions, or persistent data from those sessions. These are
implemented via the external CGI library.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top