1

I create an in-memory table in DolphinDB with the following script:

date=rand(2012.06.01..2012.06.30,100000)
time=rand(13:30:10.008..14:30:10.008,100000)
id=rand(symbol(string(100..200)),100000)
vnet_lisn_bps_avg_t=rand(100.0,100000)
t=table(date,time,id,vnet_lisn_bps_avg_t)

I check the memory usage with the function getSessionMemoryStat. The result is as follows:

enter image description here

Then I clear the table with the function clear! and check the memory usage again. There is no change in the result.

Does anyone know why?

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Winter.Z
  • 55
  • 3

1 Answers1

0

The function clear! deletes all rows of an in-memory table, but it doesn't release allocated memory of the table. To release the table completely, undefine variable t or set it to null

//release the variable t by undef function
undef(`t, VAR)

//release the table by releasing the reference count
t = NULL 
Davis Zhou
  • 353
  • 4
  • 6