:orphan:
# PetscMallocSetDRAM
Set `PetscMalloc()` to use DRAM. If memkind is available, change the memkind type. Otherwise, switch the current malloc and free routines to the `PetscMallocAlign()` and `PetscFreeAlign()` (PETSc default). 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscMallocSetDRAM(void)
```
Not Collective




## Note
This provides a way to do the allocation on DRAM temporarily. One
can switch back to the previous choice by calling `PetscMallocReset()`.


## See Also
 `PetscMallocReset()`, `PetscMalloc()`, `PetscFree()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/memory/mal.c.html#PetscMallocSetDRAM">src/sys/memory/mal.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/memory/mal.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
