Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

varchar memory allocation

 
ravi suthar
Greenhorn
Posts: 17
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one doubt in terms of Database/OS..
We know the VARCHAR is variable length Datatype. I am taking
vName varchar(20)= "Test"
so it will occupy only 4 char's memory and later 16 char's will be discarded as VARCHAR is used. But when I update the same field with "TESTDATA" then How will other 4 chars will be stored/managed ??
If any of you have idea on this issue,then let me know.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you asking about memory in the database? or in your VM?

as to be honest I have never cared, it works so haven't spent any thought on it.
How do collections work in java by the VM doing memory allocation and de-allocation for you, it is the same concept.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic