I am testing the limits of V8, and how many instances it can create, but I encounter the following error. This uses about 18TB of virtual memory, and 3500MB of real memory. I've previously run programs with 120TB of virtual memory, so I don't think the OS virtual memory limit is an issue. Perhaps V8 should be configured differently? I am using V8_COMPRESS_POINTERS. I am wondering if this could be a problem (2^32*4676 = ~20TB).
// stdout
...
Isolate: 4674
Isolate: 4675
Isolate: 4676
# Fatal error in , line 0
# Check failed: ReleasePages(page_allocator_, reinterpret_cast<void*>(region_.begin()), old_size, region_.size()).
#
#FailureMessage Object: 0x7fffe09bae80
#include <stdio.h>
#include <unistd.h>
#include <iostream>
#include <string>
#include "libplatform/libplatform.h"
#include "v8.h"
int main(int argc, char *argv[]) {
std::cout << "Loading V8..." << std::endl;
// Initialize V8.
v8::V8::InitializeICUDefaultLocation(argv[0]);
v8::V8::InitializeExternalStartupData(argv[0]);
std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
v8::V8::InitializePlatform(platform.get());
v8::V8::Initialize();
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator();
v8::Isolate *isolates[20000];
for (int i = 0; i < 20000; i++) {
std::cout << "Isolate: " << i << std::endl;
v8::Isolate *isolate = v8::Isolate::New(create_params);
isolates[i] = isolate;
}
return 0;
}