我已经使用gcc在一个AIX 6.1 ppc系统中编译了Redis 3.0.6,但是当数据库试图超过2GB的RAM时崩溃了。
编译器标志和环境变量是:
alias make="gmake"
export CC=gcc
export CFLAGS="-DAIX64 -DBIT64 -maix64 -D_AIX -D_AIX53 -D_AIX61 -I/opt/freeware/include -I/usr/include${CFLAGS_XTRA}"
export CXX=g++
export CXXFLAGS=$CFLAGS
export LDFLAGS="-DAIX64 -DBIT64 -maix64 -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib/pthread/ppc64:/opt/freeware/lib:/usr/lib:/lib,-bmaxdata:0x80000000"
export AR="ar -X64"
export LIBPATH=.:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib
export OBJECT_MODE=64
echo Gcc environment variables \(CC,CFLAGS,LDFLAGS,LIBPATH,etc\) are set.
但当它达到2GB的RAM时,会崩溃并显示以下日志:
41680910:M 12 Jan 12:46:13.056 # Out Of Memory allocating 102709 bytes!
41680910:M 12 Jan 12:46:13.056 # === REDIS BUG REPORT START: Cut & paste starting from here ===
41680910:M 12 Jan 12:46:13.056 # ------------------------------------------------
41680910:M 12 Jan 12:46:13.056 # !!! Software Failure. Press left mouse button to continue
41680910:M 12 Jan 12:46:13.057 # Guru Meditation: "Redis aborting for OUT OF MEMORY" #redis.c:3572
41680910:M 12 Jan 12:46:13.057 # ------------------------------------------------
我尝试执行
时也会崩溃redis-server --test-memory 2048
但如果我执行
则不行redis-server --test-memory 2047
很明显,它必须是我无法找到的2GB限制。
需要任何想法或进一步的信息吗?
答案 0 :(得分:4)
尝试省略-bmaxdata:0x80000000。在64位版本中,此参数将堆大小限制为2GB。在32位版本中,它会将低默认值增加到2GB。