# cudaMalloc Limit

**URL:** <https://forums.developer.nvidia.com/t/cudamalloc-limit/4602>\
**Category:** CUDA Programming and Performance\
**Created:** [July 17, 2008, 2:39am UTC](https://forums.developer.nvidia.com/t/cudamalloc-limit/4602 "2008-07-17T02:39:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flexlm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@flexlm](https://forums.developer.nvidia.com/u/flexlm)\
**Post date:** [July 17, 2008, 2:39am UTC](https://forums.developer.nvidia.com/t/cudamalloc-limit/4602/1 "2008-07-17T02:39:57Z")

</div>

I try to Malloc more than 512Mb memory use cudaMalloc on C870 board and it report error.  
Does any on know is there any limit on cudaMalloc ?

---

<div class="post-metadata">

**Author:** ![Sarnath](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarnath/32/9742_2.png) [@Sarnath](https://forums.developer.nvidia.com/u/Sarnath)\
**Post date:** [July 17, 2008, 10:36am UTC](https://forums.developer.nvidia.com/t/cudamalloc-limit/4602/2 "2008-07-17T10:36:17Z")

</div>

> [@](#):
>
> I try to Malloc more than 512Mb memory use cudaMalloc on C870 board and it report error.
> 
> Does any on know is there any limit on cudaMalloc ?
> 
> [snapback]411940[/snapback]

Did you allocate that much bytes or integers? r u sure it is 512M bytes?

---

<div class="post-metadata">

**Author:** ![MisterAnderson42](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MisterAnderson42](https://forums.developer.nvidia.com/u/MisterAnderson42)\
**Post date:** [July 17, 2008, 12:15pm UTC](https://forums.developer.nvidia.com/t/cudamalloc-limit/4602/3 "2008-07-17T12:15:27Z")

</div>

No problems here. I just allocated 1.3 GiB successfully on my C870.

```auto
#include <stdio.h>

int main()

    {

    void *data;

    cudaError_t error = cudaMalloc(&data, (int)(1.3*1024*1024*1024));

    if (error != cudaSuccess)

        printf("error");

    else

        printf("success");

   cudaFree(data);

    return 0;

    }

```
