Avoid OOM while compiling system libraries
authorWoongsuk Cho <ws77.cho@samsung.com>
Fri, 14 Jan 2022 05:05:17 +0000 (14:05 +0900)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Sun, 16 Jan 2022 21:23:20 +0000 (06:23 +0900)
If run AOTC the system library at once, it will be terminated by the OOM killer.
To avoid this, run AOTC separately (netcoreapp and framework).

NativeLauncher/tool/ni_common.cc

index abf91d4..88fb06c 100644 (file)
@@ -427,6 +427,8 @@ static ni_error_e crossgen2PipeLine(const std::vector<std::string>& dllList, con
 
                                _SOUT("Native image %s generated successfully.", niPath.c_str());
                        }
+               } else {
+                       _SERR("Failed. Forked process terminated abnormally");
                }
        } else {
                std::vector<const char*> argv;
@@ -486,6 +488,8 @@ static ni_error_e crossgen2NoPipeLine(const std::vector<std::string>& dllList, c
                                }
 
                                _SOUT("Native image %s generated successfully.", niPath.c_str());
+                       } else {
+                               _SERR("Failed. Forked process terminated abnormally");
                        }
                } else {
                        std::vector<const char*> argv;
@@ -690,7 +694,12 @@ ni_error_e createNIPlatform(NIOption* opt)
                return ret;
        }
 
-       return createNIUnderDirs(__pm->getRuntimePath() + ":" + __pm->getTizenFXPath(), opt);
+       ret = createNIUnderDirs(__pm->getRuntimePath(), opt);
+       if (ret != NI_ERROR_NONE) {
+               return ret;
+       }
+
+       return createNIUnderDirs(__pm->getTizenFXPath(), opt);
 }
 
 ni_error_e createNIDll(const std::string& dllPath, NIOption* opt)