Repository: node
Issue: Forked process with "import" (ES6) fails in Heroku env with 512mb of memory
Labels: child_process,memory

### Version

16.13.2

### Platform

Darwin MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64 x86_64

### Subsystem

_No response_

### What steps will reproduce the bug?

Parent process:
```
import {fork} from 'node:child_process';
let options = {
   stdio: [ 'pipe', 'pipe', 'pipe', 'ipc' ],
   env: Object.assign({}, process.env, { NODE_DEBUG: '*' })
};
const child = fork('./childFork.js',['param'], options);
child.on('message', message => {
   console.info('message from child:' + message);
})
```
Child forked process:
```
process.on('uncaughtException', function (err) {
   process.send({stack: err.stack, message: err.message}, null, {}, _ => {
      process.exit(1);
   });
});
process.send('READY');
```

When project's `package.json` is configured to use the new `imports` instead of the old `requires` ("type": "module") the forked process fails with SIGABRT error. It fails only on Heroku Standard X1 env (512Mb) and runs well on X2 env (1Gb).
The main process runs with parameters:
`node --expose-gc --optimize_for_size --max_old_space_size=9200 main.js`

### How often does it reproduce? Is there a required condition?

The `import` forks fail on Heroku smallest 512Mb envs.

### What is the expected behavior?

The child forks with `imports` should run on the same env as with `requires`.

### What do you see instead?

The child forked process starts to load:
```
MODULE 193: Module._load REQUEST /app/.heroku/heroku-nodejs-plugin parent: internal/preload
MODULE 193: looking for "/app/.heroku/heroku-nodejs-plugin" in ["/app/node_modules","/node_modules","/app/.node_modules","/app/.node_libraries","/app/.heroku/node/lib/node"]
MODULE 193: load "/app/.heroku/heroku-nodejs-plugin/index.js" for module "/app/.heroku/heroku-nodejs-plugin/index.js"
MODULE 193: Module._load REQUEST util parent: /app/.heroku/heroku-nodejs-plugin/index.js
MODULE 193: load native module util
MODULE 193: Module._load REQUEST http parent: /app/.heroku/heroku-nodejs-plugin/index.js
MODULE 193: load native module http
MODULE 193: Module._load REQUEST https parent: /app/.heroku/heroku-nodejs-plugin/index.js
MODULE 193: load native module https
MODULE 193: Module._load REQUEST url parent: /app/.heroku/heroku-nodejs-plugin/index.js
MODULE 193: load native module url
MODULE 193: Module._load REQUEST events parent: /app/.heroku/heroku-nodejs-plugin/index.js
MODULE 193: load native module events
MODULE 193: Module._load REQUEST ./heroku-nodejs-plugin.node parent: /app/.heroku/heroku-nodejs-plugin/index.js
MODULE 193: RELATIVE: requested: ./heroku-nodejs-plugin.node from parent.id /app/.heroku/heroku-nodejs-plugin/index.js
MODULE 193: looking for ["/app/.heroku/heroku-nodejs-plugin"]
MODULE 193: load "/app/.heroku/heroku-nodejs-plugin/heroku-nodejs-plugin.node" for module "/app/.heroku/heroku-nodejs-plugin/heroku-nodejs-plugin.node"
TIMER 193: no 20000 list was found in insert, creating a new one
```
...and suddenly fails with SIGABRT.

When the main process runs on a bigger env with 1Gb of memory it loads child process successfully:
```
ESM 193: Storing file:///app/childFork.js in ModuleMap
ESM 193: Translating StandardModule file:///app/childFork.js
message from child: READY
```

When the main process runs with the old-fashion `require` config it runs forks well even on the 512Mb env:
```
MODULE 193: looking for "/app/childFork.js" in ["/app/.node_modules","/app/.node_libraries","/app/.heroku/node/lib/node"]
MODULE 193: load "/app/childFork.js" for module "."
message from child: READY
```

### Additional information

Please confirm if `import` projects have higher memory requirements than the `require` projects.