有一天老師突然MSN丟我說:" tallman cell和cell1~3沒辦法 malloc 超過 512MB,你可能要改一下 kernal"
我回答說:"好 我在重編 弄好跟你說"
誰知道下一句就是..........
老師:"你欠扁"
老師:"cell1 ~ 3 不能用 joe"
老師:"欠扁欠扁"
害我一時間以為我遇到"流氓教授"哩!
====================================================================================
所以我上網路查了一下,有了Solution,自己做個筆記避免忘記:

FreeBSD limits the size of a process to 512MB, even if you have much more RAM available on the system.
So you may get an error such as this:

Out of memory (Needed 16391 bytes)

In current versions of FreeBSD (at least 4.x and greater), you may increase this limit by adding the following
entries to the /boot/loader.conf file and rebooting the machine (these are not settings that can be changed at
run time with the sysctl command):

kern.maxdsiz="1073741824" # 1GB
kern.dfldsiz="1073741824" # 1GB
kern.maxssiz="134217728" # 128MB

For older versions of FreeBSD, you must recompile your kernel to change the maximum data segment size for
a process. In this case, you should look at the MAXDSIZ option in the LINT config file for more information.

也就是在 /boot/loader.conf 的地方,加入上面幾行就可以解決問題了,這個問題好像會發生在你寫成是跟系統要
超過 512MB 或有一些資料庫應用的地方會有這些問題,而上面的值也可以自行在加大,如果你的實體記憶體很大
的話,但是有人有試驗說最大最好設2G,設超過4G好像會有問題,而這個問題主要是會發生在 32Bit 的環境下,
若你的 OS 灌的是 64Bit 則不會有這個問題的樣子。
arrow
arrow
    全站熱搜

    tallman 發表在 痞客邦 留言(0) 人氣()