Using JDBC connection to MSSQL Server database, the amount of memory being used seems to be more than two times the size of the output variables
My output variables is of around 22 GB. However, memory command indicates that 60 GB of memory is in use after the database call.
I think under the hood, somehow this memory leak is happening. How can I get rid of this additional memory usage.
>> memory Maximum possible array: 444201 MB (4.658e+11 bytes) * Memory available for all arrays: 444201 MB (4.658e+11 bytes) * Memory used by MATLAB: 4578 MB (4.800e+09 bytes) Physical Memory (RAM): 393092 MB (4.122e+11 bytes) >> % DOWNLOAD DATA FROM DATABASE INTO A MATLAB VARIABLE
>> memory Maximum possible array: 389034 MB (4.079e+11 bytes) * Memory available for all arrays: 389034 MB (4.079e+11 bytes) * Memory used by MATLAB: 59409 MB (6.229e+10 bytes) % Memory increase to 59 GB
Physical Memory (RAM): 393092 MB (4.122e+11 bytes) >> clear all >>memory Maximum possible array: 424252 MB (4.449e+11 bytes) * Memory available for all arrays: 424252 MB (4.449e+11 bytes) * Memory used by MATLAB: 24215 MB (2.539e+10 bytes) % Memory decrease to only 24 GB
Physical Memory (RAM): 393092 MB (4.122e+11 bytes)
As you can see, around 24 GB of extra memory is still there after executing the "clear all" command
Best Answer