PER_COMMAND causes DataBlade API to free memory when the current SQL statement finishes executing, unless it is a cursor statement (DECLARE, OPEN, FETCH, positioned UPDATE or DELETE, CLOSE), in which case DataBlade API frees the memory when the cursor closes.