RE: XForms: memory usage and calloc

From: Steve Lamont (spl@ncmir.ucsd.edu)
Date: Mon Dec 04 2000 - 17:00:55 EST

  • Next message: Yann Guichoux: "XForms: cygwin & NT"

    # To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :

    > > I have question thats not xforms related but perhaps
    > > someone here knows the answer. I want to allocate
    > > several large block of memory using one of the
    > > functions such as malloc or calloc. Is there a way to
    > > do this so that only physical memory is used ( no swap
    > > space )?
    >
    > Try
    >
    > man mlockall
    > man munlockall

    The problem with these functions is that they must be executed as
    root -- or at least that's the case under Solaris and IRIX.

    You *might* be able to pull some sort of trick with shared memory --
    see shmop() and friends -- or perhaps with mmap(). Some versions of
    mmap() have a MAP_NORESERVE flag which avoids reserving swap space.

    This all, of course, circumlocutes the real question, which is why do
    you want to do this in the first place. Grabbing large chunks of real
    memory can have serious negative performance consequences for the rest
    of the system. If you're doing some sort of real time application,
    which is about the only justification I can think of for this kind of
    hack, and things are really, really, really critical, you may want to
    consider developing your application under one of the real time
    operating systems, such as LynxOS, instead.

                                                            spl
    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Mon Dec 04 2000 - 17:05:12 EST