13.4.3. PetscMalloc() Calls

Up: Contents Next: Data Structure Reuse Previous: Sparse Matrix Factorization

Users should employ a reasonable number of PetscMalloc() calls in their codes. Hundreds or thousands of memory allocations may be appropriate; however, if tens of thousands are being used, then reducing the number of PetscMalloc() calls may be warranted. For example, reusing space or allocating large chunks and dividing it into pieces can produce a significant savings in allocation overhead. Section Data Structure Reuse gives details.


Up: Contents Next: Data Structure Reuse Previous: Sparse Matrix Factorization