Doubt related to symbol table

1 ) at compile-time in the symbol table for memory allocation, compiler stores which address starting bucket or ending bucket of the array variable in virtual memory?

2)for how long the memory allocated to the variable lasts if we do not delete it. Please clear this as my teacher was telling it will be present in the ram forever?

  1. like in dynamic allocation if we simply reassign the pointer without delete it stays in the heap but if we re assign the variable in the static memory does the memory assigned automatically gets deleted or stays?

hello @anandsingh3210

base address of array (starting bucket address)

depends on multiple things (read about static allocation , dynamic allocation ,static variables, scope of variables,life time of variables ,global variable to get answer to this question)
also read about memory leak .

yeah on static allocation it will get deleted on its own.

depends on multiple things (read about static allocation , dynamic allocation ,static variables, scope of variables,life time of variables ,global variable to get answer to this question)
also read about memory leak .

I am talking about dynamic allocaton

in case of dynamic allocation there is something called memory leak.
In memory leak , memory will remain allocated even if u close ur program.

but starting ur operating system again will solve this issue.

u mean our OS will delete the allocated memory after the execution of the program even if we forget to delete the memory allocated or lost its by switching the pointer

I said restarting the whole system will solve the issue becuase when we restart all the allocated resource get free.

also there is something called garbage collector (in java) do check it out .

ok understood thank you

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.