MartinKoch123 / yaml

MATLAB YAML parser and emitter based on SnakeYAML
MIT License
22 stars 7 forks source link

Out of Memory Error #11

Closed SDADEEC closed 7 months ago

SDADEEC commented 1 year ago

Hi, I'm trying to load a 78mb yaml file using 'yaml.loadFile' function. But I then get an error message indicating an Out of Memory error. The Current Folder part also becomes blank even I change to a different directory after this error occurs.

Would you please tell me if this problem is solvable? Is that possible to allocate more memory for loading the yaml file?

The full error message is listed below

Error using yaml.load (line 44)
Failed to load YAML string.

Error in yaml.loadFile (line 44)
result = yaml.load(content, "ConvertToArray", options.ConvertToArray);

Error in Tr_beforeRANSAC_Investigation (line 144)
tr_yaml = yaml.loadFile(yaml_tr_name);

Caused by:
    Error using yaml.load (line 42)
    Java exception occurred:
    java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.util.HashMap.newNode(HashMap.java:1750)
        at java.util.HashMap.putVal(HashMap.java:631)
        at java.util.HashMap.put(HashMap.java:612)
        at java.util.HashSet.add(HashSet.java:220)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:132)
        at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:204)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:158)
        at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:204)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:158)
        at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:204)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:158)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:123)
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106)
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121)
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480)
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:399)

Exception in thread "Explorer NavigationContext request queue": java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:68)
    at java.lang.StringBuilder.<init>(StringBuilder.java:101)
    at com.mathworks.mlwidgets.explorer.model.vfs.LocationMap.getEntry(LocationMap.java:85)
    at com.mathworks.mlwidgets.explorer.model.vfs.LocationMap.getNearestEntry(LocationMap.java:72)
    at com.mathworks.mlwidgets.explorer.model.vfs.VirtualFileSystem.resolveLocation(VirtualFileSystem.java:289)
    at com.mathworks.mlwidgets.explorer.model.vfs.VirtualFileSystem.getTarget(VirtualFileSystem.java:277)
    at com.mathworks.mlwidgets.explorer.model.vfs.VirtualFileSystem.resolveLocation(VirtualFileSystem.java:286)
    at com.mathworks.mlwidgets.explorer.model.vfs.VirtualFileSystem.getTarget(VirtualFileSystem.java:277)
    at com.mathworks.mlwidgets.explorer.model.vfs.VirtualFileSystem.isMountPoint(VirtualFileSystem.java:240)
    at com.mathworks.mlwidgets.explorer.model.vfs.VirtualFileSystem.toExternalEntry(VirtualFileSystem.java:325)
    at com.mathworks.mlwidgets.explorer.model.vfs.VirtualFileList.getLocationEntry(VirtualFileList.java:47)
    at com.mathworks.mlwidgets.explorer.model.table.UiFileList$PollingNotificationMacPathsWorkaround.<init>(UiFileList.java:545)
    at com.mathworks.mlwidgets.explorer.model.table.UiFileList.diffAndSendEvents(UiFileList.java:418)
    at com.mathworks.mlwidgets.explorer.model.table.UiFileList.updateCache(UiFileList.java:396)
    at com.mathworks.mlwidgets.explorer.model.table.UiFileList.readAndUpdateCache(UiFileList.java:372)
    at com.mathworks.mlwidgets.explorer.model.table.UiFileList.access$500(UiFileList.java:45)
    at com.mathworks.mlwidgets.explorer.model.table.UiFileList$6.run(UiFileList.java:325)
    at com.mathworks.util.RequestQueue.execute(RequestQueue.java:129)
    at com.mathworks.util.RequestQueue.access$000(RequestQueue.java:25)
    at com.mathworks.util.RequestQueue$2.run(RequestQueue.java:79)
    at java.lang.Thread.run(Thread.java:748)

The below part is from my script

Error in Tr_beforeRANSAC_Investigation (line 144)
tr_yaml = yaml.loadFile(yaml_tr_name);
MartinKoch123 commented 1 year ago

I don't think I can solve this since the core YAML parsing is done by the external tool snakeyaml and I would expect that Matlab uses all the available working memory automatically. How much working memory is actually being used when you load the file?