LiquidPlayer / LiquidCore

Node.js virtual machine for Android and iOS
MIT License
1.01k stars 127 forks source link

Memory leak on iOS #194

Open uynguyen505 opened 3 years ago

uynguyen505 commented 3 years ago

It seems to have a memory leak problem with the LiquidCore Framework on iOS. The memory keeps increasing whenever I declare a new LCMicroService instance and start it. It took ~20M per each calling start function.

let service = LCMicroService(url: indexJSPath, delegate: self)!
service.start()

I certainly call process.exit(0); inside the js file, the delegate also receives an event indicating that process has been exited.

extension MyObject: LCMicroServiceDelegate, LCMicroServiceEventListener {
    func onExit(_ service: LCMicroService, exitCode: Int32) {
        print("exit")
    }

Despite whatever I tried, there's no luck to get rid of this memory leak issue.

LCMicroService.uninstall(service.serviceURI)
service.process?.keepAlive().letDie()
service.process?.exit(0)

Is it a known issue on iOS? Please correct me if I miss something. Thank you so much.

Screen Shot 2020-09-17 at 16 08 49