I've spent two days trying to figure out why Maple won't allocate more than 512 MB of memory on my Mac. I've checked all the forums here an on Apple and it seems that this is a problem which has been around for at least two years, without being properly resolved. Previous posts can be found here:

http://www.mapleprimes.com/forum/memoryproblemsmac

http://www.mapleprimes.com/blog/mathgeek/macandmaplekernelissue

I've discussed with technical support from both Apple and Maple, and it seems we have narrowed the problem to a larger issue with the Maple script than was realised in the previous 2 forums.

Essentially, the problem is this: there is a file, `.../bin.APPLE_UNIVERSAL_OSX/mserver_ulimit' which can be altered so that the upper limit to the amount of memory Maple can use may be any arbitrary number up to `unlimited', for which the `datalimit' inside Maple is set to infinity. In the current distribution of Maple 13, and possibly in earlier releases, this value is set to unlimited, by default. However, kernelopts(datalimit) returns 409600 (kibibytes). The reason this happens is that there is a 512000 kibibyte maximum that is externally set in the maple script. The mserver_ulimit file actually offers a list of values which are submitted to be ulimit, and the value is set at the largest number below that cutoff. In the currently distributed code, the value which meets this criterion is 409600, but can be manually altered to anything up to 512000. Alternatively, all the values less than `unlimited' may be deleted from mserver_ulimit, so that after it is re-executed the datalimit is set to that global upper limit---512000.

The file which contains the error is, I think, `.../bin/maple'. Please check this by opening this executable file in a text editor and searching for `ulimit'. I'm not a programmer, but is seems pretty obvious to me that code like

DLIMIT=`ulimit -d`
        if [ "$DLIMIT" = 6144 ]
        then
            ulimit -d 512000 1>/dev/null 2>&1 || ulimit -d 409600 1>/dev/null 2>&1 || ulimit -d 1>/dev/null 2>&1 307200
        fi

 

or,

DLIMIT=`ulimit -d`
        if [ $DLIMIT != "unlimited" ]; then
            if [ $DLIMIT -lt 512000 ]; then
                ulimit -d 512000 2>/dev/null || ulimit -d 409600 2>/dev/null || ulimit -d 307200 2>/dev/null || echo "Unable to set the required datalimit.  Maple may not function properly."
                DLIMIT=`ulimit -d`
                if [ $CUSTOMHEAP -ne 0 ]; then
                    JAVAHEAP=`expr $DLIMIT / 1024 - 50`
                fi
            fi
        fi

 

must be the culprit. The first part is the code for running Maple on Mac OS. My friend at technical support is going to talk to a developer to see if this can not be fixed so that ulimit can be set to unlimited, as for Windows and Linux platforms.

If anyone has any further insight, or can offer a solution, or if a replacement file is written and made available which could fix this problem, please post it! There are forums covering this issue on both Apple.com and MaplePrimes, so I know there are other Mac users who have been having this issue for more than 2 years.


Please Wait...