Opened 20 months ago

Closed 4 months ago

#1675 closed defect (fixed)

Maximum heap size is limited on 64-bit machines

Reported by: felix winkelmann Owned by:
Priority: minor Milestone: 5.3
Component: core libraries Version: 5.1.0
Keywords: Cc:
Estimated difficulty: trivial

Description

DEFAULT_MAXIMAL_HEAP_SIZE is set to 0x7ffffff0, which seems to be a 32-bit legacy. I guess it would be appropriate to use 0x7ffffffffffffff0 if C_SIXTY_FOUR is defined.

Attachments (1)

0001-Increase-maximum-heap-size-on-64-bit-machines.patch (1.1 KB) - added by Diego 5 months ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 20 months ago by sjamaan

Milestone: 5.25.3

I don't think this is needed for 5.2.0; it's only the default value, which can be easily overridden.

comment:2 Changed 20 months ago by felix winkelmann

It's actually the total maximum, which is not changable via command-line options (C_maximal_heap_size).

comment:3 Changed 20 months ago by sjamaan

Unless I'm mistaken, that can be overridden with -:m, see runtime.c line 1397.

comment:4 Changed 20 months ago by felix winkelmann

Yes, I totally overlooked that, for some reason.

comment:5 Changed 5 months ago by Diego

This might be silly but here's a patch

comment:6 Changed 4 months ago by sjamaan

I'm not sure this new constant is a sane value - it's 9 exabyte if I'm not mistaken. No machine available today has that kind of memory (and it will probably take a lot of time before any machine will - though if you include swap that day might be closer than we think).

What's the original purpose of the maximal heap size? It being 2GB on 32-bit systems seems to be half the maximum addressable size (which makes sense if you consider that the maximum heap would be double that, but also a little pointless because at that point you'll have eaten up all memory anyway - that memory won't typically all be available. Except there's swap...)

comment:7 in reply to:  6 Changed 4 months ago by felix winkelmann

Replying to sjamaan:

What's the original purpose of the maximal heap size? It being 2GB on 32-bit systems seems to be half the maximum addressable size (which makes sense if you consider that the maximum heap would be double that, but also a little pointless because at that point you'll have eaten up all memory anyway - that memory won't typically all be available. Except there's swap...)

This is only a theoretical limit, to be used to mask out significant bits from the header value, not a commitment on the heap size we want to support. 2GB seemed insane a while ago. And we all know that 640KB is more than enough.

comment:8 Changed 4 months ago by Mario Domenech Goulart

Resolution: fixed
Status: newclosed

Fixed by 0879e31f6181bfe87484ffbbec90b38bf9f728cd.

Note: See TracTickets for help on using tickets.