Triangular matrix object

In a C++ simulation I have an n*n matrix, it’s so large that it can’t fit my memory, but this matrix is symmetrical, How could I generate only one of the triangular parts and free the other triangle …