firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Information request buffer allocation

Open AlexPeshkoff opened this issue 7 months ago • 5 comments

Server allocates memory for subj according to client request. And as long as client can request up to 4Gb - 1 this causes use of too much of virtual address space. Worse, currently server zeros that buffer in advance, which causes abuse of physical RAM.

Plans to fix first of all second problem. Return to virtual space later.

AlexPeshkoff avatar Apr 27 '25 15:04 AlexPeshkoff

@mrotteveel Mark, can you retry your test with 0xFFFFFFFF size of buffers with current snapshot of fb6? I wonder did my small change affect performance.

AlexPeshkoff avatar May 05 '25 17:05 AlexPeshkoff

@AlexPeshkoff I guess you mean 0xFFFEFFFF, as the code in protocol.cpp intentionally treats values in the range 0xFFFF0000-0xFFFFFFFF as if it's 16-bits unsigned (i.e., it ignores the high 16 bits if those high 16 bits are 0xFFFF).

mrotteveel avatar May 06 '25 09:05 mrotteveel

Seems to be a lot better:

Test run (unmodified Jaybird): 6.0.0.708: 2m36s 6.0.0.770: 2m38s

Test run (modified Jaybird): 6.0.0.708: 47m29s 6.0.0.770: 5m09s

Note that Firebird's memory still spikes in Task Manager, as it reports virtual memory, not physical memory.

mrotteveel avatar May 06 '25 09:05 mrotteveel

In short, the change reduced the runtime from ~47 minutes to ~5 minutes.

mrotteveel avatar May 06 '25 10:05 mrotteveel

In that case I will backport it to all supported branches - and proceed with API enhancement no hurry.

AlexPeshkoff avatar May 06 '25 11:05 AlexPeshkoff