Reached heap limit Allocation failed - JavaScript heap out of memory

## Bug report

### Required System information

- Node.js version: 21.7.3
- NPM version: (Belirtilmemiş, ekleyin)
- Strapi version: (Belirtilmemiş, ekleyin)
- Database: (Belirtilmemiş, ekleyin)
- Operating system: macOS
- Is your project Javascript or Typescript: (Belirtilmemiş, ekleyin)

### Describe the bug

During the execution of the application, the following fatal error occurs: `JavaScript heap out of memory`. This issue seems to happen during the garbage collection phase, as indicated in the logs. 

### Steps to reproduce the behavior

1. Start the application using Node.js version 21.7.3.
2. Execute a memory-intensive operation or a specific API endpoint.
3. Observe the terminal logs where the error appears.

### Expected behavior

The application should handle memory allocation efficiently and not crash due to a heap limit being reached.

### Screenshots

N/A

### Code snippets

Here are the relevant error logs:
```plaintext
<--- Last few GCs --->

<--- Last few GCs --->

[38620:0x7fec38008000]   343985 ms: Mark-Compact 3915.6 (4130.8) -> 3908.1 (4130.0) MB, 1081.36 / 0.00 ms  (average mu = 0.671, current mu = 0.091) allocation failure; scavenge might not succeed
[38620:0x7fec38008000]   345978 ms: Mark-Compact 3924.0 (4130.0) -> 3918.6 (4156.3) MB, 1974.73 / 0.00 ms  (average mu = 0.316, current mu = 0.009) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0x10e693d00 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/****/.nvm/versions/node/v21.7.3/bin/node]
 2: 0x10e88349c v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/****/.nvm/versions/node/v21.7.3/bin/node]
 3: 0x10ea83197 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/***/.nvm/versions/node/v21.7.3/bin/node]
 4: 0x10ea80cc8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/****/.nvm/versions/node/v21.7.3/bin/node]
 5: 0x10ea7660b v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/***/.nvm/versions/node/v21.7.3/bin/node]
 6: 0x10ea76ec5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/***/.nvm/versions/node/v21.7.3/bin/node]
 7: 0x10ea58502 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/****/.nvm/versions/node/v21.7.3/bin/node]
 8: 0x10eeb9ff9 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/***/.nvm/versions/node/v21.7.3/bin/node]
 9: 0x10f2eb936 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/****/.nvm/versions/node/v21.7.3/bin/node]
```
The error might be resolved by increasing the memory limit using the --max-old-space-size flag in Node.js or by optimizing the application to reduce memory usage. Please let me know if additional logs or configurations are required.
