It works for me:
$ gmic sp lena,6000 afre_y50 1 colormap 0
[gmic]-0./ Start G'MIC interpreter.
[gmic]-1./ Input sample image 'lena' (1 image 6000x6000x1x3).
[afre]^_^) y50: Compute luminance (D50 Rec.2020) of image [0].
[gmic]-1./ Estimate full colormap for image [0].
[gmic]-1./ Display image [0] = '[colormap of lena]'.
[0] = '[colormap of lena]':
size = (273023,1,1,1) [1066 Kio of floats].
data = (27.632,27.6776,27.911,27.9566,28.1901,28.3529,28.3985,28.4441,28.5864,28.632,28.6776,28.7232,(...),225.902,225.922,225.938,225.948,225.983,225.993,226.029,226.08,226.09,226.126,226.135,226.171).
min = 27.632, max = 226.171, mean = 136.19, std = 38.806, coords_min = (0,0,0,0), coords_max = (273022,0,0,0).
I have 4GB of RAM, and run Ubuntu Linux.
Are you running it on Windows ?