What exactly does the updated code look like? Are you using draw_flush or d3d_set_identity?
I find it a bit weird that it still tries to allocate a giant buffer of 1/6th of everything else it's rendering when it's totally fine with thousands of smaller ones, are you sure you didn't miss adding the safety code anywhere?