How can I prevent "zend_mm_heap corrupted" when adding Views programmatically? I have created a module that has 150 views added to mymodule.views_default.inc.

At first I could not get this to load as I was running out of memory. After increasing my memory to a sufficient limit, I now always get the error:

zend_mm_heap corrupted


Has anyone encountered this before while adding views to their modules?
There are several bugs reported to php.net about this error (search "drupal zend_mm_heap corrupted). Indeed it turned out to be a PHP bug with php 5.3.

I upgraded to php 5.4 and the error goes away. 

The issue is not necessarily Drupal related. However, it does seem to be related to how php includes and processes large files. In that respect, since Drupal can end up dealing with massive amounts of files and php data, this is probably the reason that many of the reported PHP bugs involved Drupal sites.

So, if you are getting this error, quite possibly you need to upgrade your PHP to 5.4