Hello Guys,
We are trying to import the Gantt from an XML file and that is giving us the error of “Paused before potential out of memory crash” in Google Developer tools and the script is stopped in the dhtmlxgantt.js
file in Developer tools. After getting the data from the Imported file I am parsing the data like this and then assigning the types of the tasks and deleting the Summary Task (to Link).
/**
* * Gantt Parse event
*/
const onParse = gantt.attachEvent('onParse', () => {
gantt.eachTask(task => {
if (this.isloadingGanttFromMSP) {
// checking for every task if it is Task, Project, MileStone or
// Summary Task
if (gantt.hasChild(task.id) && task.$level === 0) {
// assigning the type to the task
task.type = gantt.config.types.project;
task.activity_code = gantt.getWBSCode(task);
task.is_critical = gantt.isCriticalTask(task);
} else if (task.duration === 0) {
// assigning the type to the task
task.type = gantt.config.types.milestone;
task.activity_code = gantt.getWBSCode(task);
task.is_critical = gantt.isCriticalTask(task);
} else if (gantt.hasChild(task.id) && task.$level !== 0) {
const links = gantt.getLinks();
links.forEach(link => {
if (link.target === task.id) {
gantt.deleteLink(link.id);
}
});
// assigning the type to the task
task.type = gantt.config.types.project;
task.activity_code = gantt.getWBSCode(task);
task.is_critical = gantt.isCriticalTask(task);
} else {
// assigning the type to the task
task.type = gantt.config.types.task;
task.activity_code = gantt.getWBSCode(task);
task.is_critical = gantt.isCriticalTask(task);
}
} else {
this.refreshSummaryProgress(task.id);
}
});
if (this.isloadingGanttFromMSP) {
// creating task and calculating float
this.updateTaskInfoAfterImport();
}
});
I am not getting why this error is coming randomly. For small files, it’s not showing this error but for the file with 1200 tasks, this error is coming randomly.
Please help me. I am facing this issue for a long time. Thanking you.