# bugs related to memory allocation

**URL:** <https://forums.developer.nvidia.com/t/bugs-related-to-memory-allocation/900>\
**Category:** CUDA Programming and Performance\
**Created:** [June 13, 2007, 7:39am UTC](https://forums.developer.nvidia.com/t/bugs-related-to-memory-allocation/900 "2007-06-13T07:39:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asadafag](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/asadafag/32/216303_2.png) [@asadafag](https://forums.developer.nvidia.com/u/asadafag)\
**Post date:** [June 13, 2007, 7:39am UTC](https://forums.developer.nvidia.com/t/bugs-related-to-memory-allocation/900/1 "2007-06-13T07:39:09Z")

</div>

my program uses a lot of GPU memory allocation and free, using both cudaMalloc/cudaFree and glBufferData to maintain several STL vector like structures. It runs fine in emulation mode, but get very strange result in release mode:  
A small section in the middle of a piece of memory i cudaMalloced becomes unwritable by my kernel (any write to it in kernel silently fails), but cudaMemcpy to it works. this doesn’t happen if i allocating the memory twice, throw away the first pointer and just use the second one.
