Changing the level only frees the memory used by the level. It does not free any other video memory.

So when you're allocating more and more memory in some function that's unrelated to the level, you'll eventually run out of memory. Video memory is not freed by level changing when it's allocated for view entities, bitmaps, materials or the like.