Thank you for your answer.
As you asked this is the entire error message (if this is what you want because it is very long):
runtime: out of memory: cannot allocate 536870912-byte block (541065216 in use)
fatal error: out of memory
runtime stack:
runtime.throw(0x56a0aa, 0xd)
/home/jenkins/go/src/runtime/panic.go:566 +0x7f
runtime.largeAlloc(0x1ffffe00, 0x112b4001, 0x112abe5c)
/home/jenkins/go/src/runtime/malloc.go:776 +0xb7
runtime.mallocgc.func1()
/home/jenkins/go/src/runtime/malloc.go:669 +0x31
runtime.systemstack(0x10ea5400)
/home/jenkins/go/src/runtime/asm_386.s:323 +0x5e
runtime.mstart()
/home/jenkins/go/src/runtime/proc.go:1079
goroutine 4 [running]:
runtime.systemstack_switch()
/home/jenkins/go/src/runtime/asm_386.s:277 fp=0x112abdcc sp=0x112abdc8
runtime.mallocgc(0x1ffffe00, 0x5478e0, 0x112abe01, 0x44c3c0)
/home/jenkins/go/src/runtime/malloc.go:670 +0x7c2 fp=0x112abe34 sp=0x112abdcc
runtime.makeslice(0x5478e0, 0x1ffffe00, 0x0, 0x1ffffe00, 0x0, 0x0, 0x0, 0x0)
/home/jenkins/go/src/runtime/slice.go:57 +0xd0 fp=0x112abe5c sp=0x112abe34
bytes.makeSlice(0x1ffffe00, 0x0, 0x0, 0x0)
/home/jenkins/go/src/bytes/buffer.go:198 +0x67 fp=0x112abe8c sp=0x112abe5c
bytes.(*Buffer).ReadFrom(0x1109a8a0, 0x5f3f50, 0x10eb2120, 0xffffe00, 0x0, 0x0, 0x0)
/home/jenkins/go/src/bytes/buffer.go:170 +0xa7 fp=0x112abee4 sp=0x112abe8c
io.copyBuffer(0x5f3df0, 0x1109a8a0, 0x5f3f50, 0x10eb2120, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/jenkins/go/src/io/io.go:384 +0x129 fp=0x112abf48 sp=0x112abee4
io.Copy(0x5f3df0, 0x1109a8a0, 0x5f3f50, 0x10eb2120, 0x0, 0x0, 0x0, 0x0)
/home/jenkins/go/src/io/io.go:360 +0x53 fp=0x112abf78 sp=0x112abf48
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
/home/jenkins/go/src/os/exec/exec.go:253 +0x57 fp=0x112abfb8 sp=0x112abf78
os/exec.(*Cmd).Start.func1(0x111c4160, 0x10ee2870)
/home/jenkins/go/src/os/exec/exec.go:370 +0x1d fp=0x112abfd0 sp=0x112abfb8
runtime.goexit()
/home/jenkins/go/src/runtime/asm_386.s:1612 +0x1 fp=0x112abfd4 sp=0x112abfd0
created by os/exec.(*Cmd).Start
/home/jenkins/go/src/os/exec/exec.go:371 +0x888
goroutine 1 [syscall, locked to thread]:
syscall.Syscall(0x751eeca0, 0x2, 0x25c, 0xffffffff, 0x0, 0x431e93, 0x10ec5418, 0x481d98)
/home/jenkins/go/src/runtime/syscall_windows.go:163 +0x4a
syscall.WaitForSingleObject(0x25c, 0xffffffff, 0x10ec5430, 0x0, 0x0)
/home/jenkins/go/src/syscall/zsyscall_windows.go:693 +0x5f
os.(*Process).wait(0x1102dbf0, 0x0, 0x0, 0x0)
/home/jenkins/go/src/os/exec_windows.go:18 +0x8b
os.(*Process).Wait(0x1102dbf0, 0x4, 0x0, 0x0)
/home/jenkins/go/src/os/doc.go:49 +0x2b
os/exec.(*Cmd).Wait(0x111c4160, 0x0, 0x0)
/home/jenkins/go/src/os/exec/exec.go:434 +0x11c
os/exec.(*Cmd).Run(0x111c4160, 0x0, 0x0)
/home/jenkins/go/src/os/exec/exec.go:279 +0x58
arduino.cc/builder/builder_utils.ExecRecipeCollectStdErr(0x11128180, 0x56c313, 0x15, 0x101, 0x5f4880, 0x614ef0, 0x0, 0x0, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder_utils/utils.go:413 +0x118
arduino.cc/builder.(*GCCPreprocRunnerForDiscoveringIncludes).Run(0x11128160, 0x10f0e000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/gcc_preproc_runner.go:93 +0x23c
arduino.cc/builder.runCommand(0x10f0e000, 0x5f39b0, 0x11128160, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/container_find_includes.go:183 +0x57
arduino.cc/builder.findIncludesUntilDone(0x10f0e000, 0x111e4620, 0x538ca0, 0x1102d6e0, 0x111e4660, 0x17, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/container_find_includes.go:331 +0x1810
arduino.cc/builder.(*ContainerFindIncludes).Run(0x614ef0, 0x10f0e000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/container_find_includes.go:149 +0xdfd
arduino.cc/builder.runCommands(0x10f0e000, 0x10ec5cc0, 0x22, 0x22, 0x1, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:191 +0xe2
arduino.cc/builder.(*Builder).Run(0x10ec5de4, 0x10f0e000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:124 +0x89f
arduino.cc/builder.RunBuilder(0x10f0e000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:222 +0x35
main.main()
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/arduino-builder/main.go:338 +0x1360
C:\Users\Jean Descazeaud\Desktop\Arduino\arduino-builder returned 2
Error compiling for board Arduino/Genuino Mega or Mega 2560.