>Hi, I've read some reports that calling mmap() on SMP systems can be >slow. Solaris has quite a few memory allocators, which makes a bit hard >to figure out the best memory allocation technique on SMP hardware. > >I have single threaded application, which allocates large chunks of >memory (256K at a time) for caching data. This allocated memory can >grow to several gigabytes in size. What do you think will give better >performance on large SMP systems, calling mmap() or one of Solaris' >general memory allocators?
If you want to free the data, then mmap() is probably the only way to do it; if you use a standard memory allocater, returning data will be difficult. >Also, Solaris' mmap() has MAP_NORESERVE flag. Would you normally use >this flag when mmaping chunks of memory for caching data? So that you >expect this data to remain in memory per performance reasons and not be >written to disk. > The only difference is that MAP_NORESERVE does not allocate swap until you use the memory; if you are going the data anyway, MAP_NORESERVE may cause problems when you run out of swap. MAP_NORESERVE should be used for stacks. Casper _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code