ukrbublik / shm-typed-array

IPC shared memory for NodeJs. Use as Buffer or TypedArray.
MIT License
71 stars 9 forks source link

Error: Too many open files #8

Open yangwuan55 opened 4 years ago

yangwuan55 commented 4 years ago

I use shm at MacOS,is the library support windows?this is the code. Look like the datas is saved to file,so is not the data in the memory?and how can I correct to use?


if (this.shmBuffer != null) {
    Buffer.from(data).copy(this.shmBuffer)
    this.worker.send( {
          key:this.shmBuffer.key,
          length:data.length
    })
}
Uncaught exception...
Error: Too many open files
    at Object.get (/Users/ymr/kaochong/klive-teacher/teacher-package/node_modules/shm-typed-array/index.js:108:16)
    at Socket.onMessage (/Users/ymr/kaochong/klive-teacher/teacher-package/src/base-sdk/net/socket/remote-socket.ts:94:39)
    at process.<anonymous> (/Users/ymr/kaochong/klive-teacher/teacher-package/src/base-sdk/net/socket/remote-socket.ts:110:18)
    at process.emit (events.js:210:5)
    at process.emit (/Users/ymr/kaochong/klive-teacher/teacher-package/node_modules/source-map-support/source-map-support.js:485:21)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
Uncaught exception...
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.js:678:16)
    at SocketImp../src/base-sdk/net/socket/socket.ts.SocketImp.sendToWorkerFromBuffer (http://localhost:3000/main_window/index.js:54502:25)
    at SocketImp../src/base-sdk/net/socket/socket.ts.SocketImp.write (http://localhost:3000/main_window/index.js:54489:14)
    at http://localhost:3000/main_window/index.js:54082:29