function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Balaram Nair 13Balaram Nair 13 

Challenge Not yet complete... here's what's wrong: There was an unexpected error in your org which is preventing this assessment check from completing: System.LimitException: Apex heap size too large: 37522619

When testing a basic apex class challenge I get this error. Any help will be appreciated.
FearNoneFearNone
balaram,

your code may contain infinite loop or it keeps on triggering database.
Balaram Nair 13Balaram Nair 13
Thanks for the response. Below is the basic class. I even hard coded inum=10. Ran it in apex anonymous with iNum=10 and don't see anything unusal. 
public class StringArrayTest {
  
  public static List<String> generateStringArray (integer iNum) {
    List<String> str = new List<String>();
    for (Integer i=0; i<iNum; i+1) {
        str.add('Test '+i);
        system.debug('Test '+i);
    }
    return str;
  }
}
FearNoneFearNone
balaram,

that is weird. your code is fine. it seems it is not the one causing the problem.
Balaram Nair 13Balaram Nair 13
Still getting the same error.
FearNoneFearNone
i see now what is wrong in the code. you had infinite loop.

try this:
for (Integer i=0; i<iNum; i=i+1) {