How to free list memory using apex?

MyList.clear();

Where MyList is a List variable.


Example:


List<Account> MyList = new List<Account>();
MyList.add(new Account(name = 'test');
MyList.clear(); // Removes the accounts


Cheers!!!

No comments:

Post a Comment