Mac 2.8 Browser plugin - Help!

John M McIntosh johnmci at smalltalkconsulting.com
Fri Sep 1 05:10:14 UTC 2000


on 9/1/00 3:05 AM, russell.allen at firebirdmedia.com at
russell.allen at firebirdmedia.com wrote:

> Hi,
> 
> I have downloaded the plugin stuff to my mac, and have tried it in iCab,
> Netscape and IE, but I always get a message saying:
> 
> There is not enough memory to give Squeak the amount specified in the
> 'memory' EMBED tag.
> 
> This is on all of the test pages, all of which specify memory="15".
> 
> I do have enough memory!  I tried increasing the memory of the browser
> (up to 150M for iCab) but that didn't work.  I tried freeing up other
> memory, but that didn't work either.  I also tried changing the memory
> request from 15 to other values.
> 
> What's up? Have I missed something?
> 
> Russell

It's memory=15

not 

memory="15"   But maybe it doesn't matter.

Also if you do not code the memory attribute, Squeak attempts to allocate 20
Megabytes. 

The memory in question is the amount to allocate for the image outside of
the working storage for the VM. This memory is allocated from the system
heap, not the application heap, so increasing the memory size of your
browser doesn't help.

There are two messages
    ...    
    dataSize = getLongFromFileswap(f, swapBytes);
    ...
    heapSize = reserveExtraCHeapBytes(desiredHeapSize, extraVMMemory);
    minimumMemory = dataSize + 100000;
    if (heapSize < minimumMemory) {
                plugInNotifyUser("The amount of memory specified by the
'memory' EMBED tag is not enough for the installed Squeak image file.");
        return null;
;
    }
    memory = (unsigned char *) sqAllocateMemory(minimumMemory, heapSize);
    if (memory == null) {
                plugInNotifyUser("There is not enough memory to give Squeak
the amount specified by the 'memory' EMBED tag.");
        return null;
;
    }


The first message means the amount of memory you are asking for is not large
enough to load the squeak image from disk.

The second message means we could not allocate the memory. Where
sqAllocateMemory is:

void * sqAllocateMemory(int minHeapSize, int desiredHeapSize) {
  /* Allocate the Squeak object heap memory from the system heap. */

#if TARGET_API_MAC_CARBON
    return NewPtr(desiredHeapSize);
#else
    return NewPtrSys(desiredHeapSize);
#endif
}

Of course NewPtrSys asks the OS to allocate the desiredHeapSize bytes from
the System heap. 

> 

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6
===========================================================================





More information about the Squeak-dev mailing list