Troubleshooting LimitExceptions
This guide explains how to troubleshoot LimitExceptions, such as:
System.AsyncException: System.LimitException: Apex heap size too large: 12000970 External entry point (valence)
Step 1: Verify Setup and Resolve Mapping Errors
- Ensure you are running the latest version of Valence.
- Review the failed run for any mapping errors (e.g., missing lookups, validation rule violations).
- Resolve all mapping errors before proceeding.
note
Make sure to check for and resolve any new mapping errors after each test run in the following steps.
Step 2: Determine the Maximum Batch Size
- Open the link's source adapter settings page.
- Set "Max Pages" to 1.
- Open the link's link settings page.
- Set "Batch Size" to 100.
- Run the link.
- Check for and resolve any mapping errors.
- If successful, double the batch size and repeat steps 5-6.
- Continue increasing the batch size until you encounter an Apex Heap or CPQ limit error.
- Set the final batch size to 80% of the size that caused the error.
- Remove the
Max Pages
in Data Source and test to see if the heap size error persists or if the issue has been resolved.
Step 3: Determine the Maximum Page Size (if needed)
If the heap size error persists:
- Open the link's source adapter settings page.
- Set "Max Pages" to 100 and run the link.
- Check for and resolve any mapping errors.
- If successful, set "Max Pages" to 250.
- Double the "Max Pages" value until you encounter the heap size error again.
- The last successful value is your maximum page count.
Step 4: Perform Initial Load in Manual Batches
Once you've determined the maximum page size:
- Set "Start Page" equal to the previously determined Max Pages.
- Run the link.
- Check for and resolve any mapping errors.
- Increment "Start Page" by the Max Pages value.
- Repeat steps 2-4 until the initial load is complete.
note
This process may require multiple manual runs to complete the initial load.