<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/memory-management",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Memory Management"
}
-->

# Memory Management

Retain and release sparse objects.

## Topics

### Resource Retention

[`func SparseRetain(SparseOpaqueSymbolicFactorization) -> SparseOpaqueSymbolicFactorization`](/documentation/Accelerate/SparseRetain(_:)-8r2dm)

Increases the reference count on a symbolic factorization object.

[`func SparseRetain(SparseOpaqueFactorization_Double) -> SparseOpaqueFactorization_Double`](/documentation/Accelerate/SparseRetain(_:)-8943y)

Increases the reference count on a double-precision numeric factorization object.

[`func SparseRetain(SparseOpaqueFactorization_Float) -> SparseOpaqueFactorization_Float`](/documentation/Accelerate/SparseRetain(_:)-7onhr)

Increases the reference count on a single-precision numeric factorization object.

[`func SparseRetain(SparseOpaqueSubfactor_Double) -> SparseOpaqueSubfactor_Double`](/documentation/Accelerate/SparseRetain(_:)-2pmdl)

Increases the reference count on a double-precision subfactor object.

[`func SparseRetain(SparseOpaqueSubfactor_Float) -> SparseOpaqueSubfactor_Float`](/documentation/Accelerate/SparseRetain(_:)-6mr6d)

Increases the reference count on a single-precision subfactor object.

[`func SparseRetain(SparseOpaqueFactorization_Complex_Double) -> SparseOpaqueFactorization_Complex_Double`](/documentation/Accelerate/SparseRetain(_:)-5sahb)

Increase reference count on a numeric factorization object,
returning a copy.

[`func SparseRetain(SparseOpaqueSubfactor_Complex_Float) -> SparseOpaqueSubfactor_Complex_Float`](/documentation/Accelerate/SparseRetain(_:)-6pp40)

Increase reference count on a numeric factorization object,
returning a copy.

[`func SparseRetain(SparseOpaqueSubfactor_Complex_Double) -> SparseOpaqueSubfactor_Complex_Double`](/documentation/Accelerate/SparseRetain(_:)-92857)

Increase reference count on a numeric factorization object,
returning a copy.

[`func SparseRetain(SparseOpaqueFactorization_Complex_Float) -> SparseOpaqueFactorization_Complex_Float`](/documentation/Accelerate/SparseRetain(_:)-92v4w)

Increase reference count on a numeric factorization object,
returning a copy.

### Resource Cleanup

[`func SparseCleanup(SparseMatrix_Double)`](/documentation/Accelerate/SparseCleanup(_:)-6ywzn)

Releases a matrix of double-precision values’ references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseMatrix_Float)`](/documentation/Accelerate/SparseCleanup(_:)-9f4vi)

Releases a matrix of single-precision values’ references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaqueFactorization_Double)`](/documentation/Accelerate/SparseCleanup(_:)-3cnxt)

Releases a factorization of a matrix of double-precision values’ references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaqueFactorization_Float)`](/documentation/Accelerate/SparseCleanup(_:)-4kus5)

Releases a factorization of a matrix of single-precision values’ references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaqueSymbolicFactorization)`](/documentation/Accelerate/SparseCleanup(_:)-6jpd8)

Releases a matrix factorization’s references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaqueSubfactor_Double)`](/documentation/Accelerate/SparseCleanup(_:)-15kpj)

Releases a double-precision subfactor object’s references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaqueSubfactor_Float)`](/documentation/Accelerate/SparseCleanup(_:)-1mrmc)

Releases a single-precision subfactor object’s references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaquePreconditioner_Double)`](/documentation/Accelerate/SparseCleanup(_:)-45lq7)

Releases a double-precision preconditioner’s references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaquePreconditioner_Float)`](/documentation/Accelerate/SparseCleanup(_:)-1qhk8)

Releases a single-precision preconditioner’s references to any memory that the Sparse Solvers library allocates.

[`func SparseCleanup(SparseOpaquePreconditioner_Complex_Float)`](/documentation/Accelerate/SparseCleanup(_:)-1jxdh)

Release a Sparse Preconditioner’s references to any memory allocated
by the sparse library.

[`func SparseCleanup(SparseOpaqueFactorization_Complex_Double)`](/documentation/Accelerate/SparseCleanup(_:)-28nz7)

Release a Sparse Object’s references to any memory allocated
by the sparse library.

[`func SparseCleanup(SparseMatrix_Complex_Double)`](/documentation/Accelerate/SparseCleanup(_:)-3wccz)

Release a Sparse matrix’s references to any memory allocated
by the Sparse library.

[`func SparseCleanup(SparseMatrix_Complex_Double)`](/documentation/Accelerate/SparseCleanup(_:)-3wccz)

Release a Sparse matrix’s references to any memory allocated
by the Sparse library.

[`func SparseCleanup(SparseOpaqueSubfactor_Complex_Float)`](/documentation/Accelerate/SparseCleanup(_:)-4enlt)

Release a Sparse Object’s references to any memory allocated
by the sparse library.

[`func SparseCleanup(SparseMatrix_Complex_Float)`](/documentation/Accelerate/SparseCleanup(_:)-4z3l9)

Release a Sparse matrix’s references to any memory allocated
by the Sparse library.

[`func SparseCleanup(SparseOpaquePreconditioner_Complex_Double)`](/documentation/Accelerate/SparseCleanup(_:)-5ajx)

Release a Sparse Preconditioner’s references to any memory allocated
by the sparse library.

[`func SparseCleanup(SparseOpaqueFactorization_Complex_Float)`](/documentation/Accelerate/SparseCleanup(_:)-61q1a)

Release a Sparse Object’s references to any memory allocated
by the sparse library.

[`func SparseCleanup(SparseOpaqueSubfactor_Complex_Double)`](/documentation/Accelerate/SparseCleanup(_:)-7nhza)

Release a Sparse Object’s references to any memory allocated
by the sparse library.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)