Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5997463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:16:03+00:00 2026-05-23T00:16:03+00:00

Good afternoon, We are building a prototype deduper for Centos Linux Release x86_32 and

  • 0

Good afternoon, We are building a prototype deduper for Centos Linux Release x86_32 and Microsoft Windows. One part of the prototype is a MemoryMappedFile program which uses a 1800 element cache. For Centos Linux 5.5 we call msync to synchronize the file with the memory map. For the last several weeks, msync has been functioning okay.
Today, msync and perror(“msync”) are returning “Cannot allocate memory”. Why is Centos Linux Version 5.5 x86_32 msync returning “Cannot Allocate memory”? Is it possible for use to fix the “Cannot Allocate memory” error on Centos Linux 5.5 x86_32. Thank you. An excerpt of the memory mapped file program code is shown below:

        typedef std::multimap<char *,Range>::const_iterator I;  
    std::pair<I,I> b = mmultimap.equal_range(TmpPrevMapPtr); 
         for (I i=b.first; i != b.second; ++i){ 
    std::deque<Range>::iterator iter;
    iter = std::lower_bound(ranges_type.begin(),ranges_type.end(),i->second);
              if (iter != ranges_type.end() && !(i->second < *iter)){
        sz1 = ranges_type.size();
                        ranges_type.erase(iter);
        sz2 = ranges_type.size();
    }
    }
    erasecount = mmultimap.erase(TmpPrevMapPtr); 
    #if defined(__windows)
    retval = FlushViewOfFile(TmpPrevMapPtr, mappedlength);
    retval =    UnmapViewOfFile(TmpPrevMapPtr);            
    #elif defined(__unix)
         retval = msync(TmpPrevMapPtr,   mappedlength, MS_SYNC);    
    if (retval == -1){                                        
       perror("msync");                                       
         }                                                       
         retval = munmap(TmpPrevMapPtr,  mappedlength);
    if (retval == -1){                    
       perror("munmap");                        
           throw cException(ERR_MEMORYMAPPING,TempFileName);
         }
    #endif
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:16:04+00:00Added an answer on May 23, 2026 at 12:16 am

    The msync man page states:

     ENOMEM The indicated memory (or part of it) was not mapped.
    

    That’s the errno value perror() prints for you. So you’re somehow trying to msync() memory that you’ve not mmap()’ed from a file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
Good afternoon, I have a web query in Excel 2002 going against a web
Good afternoon, with all the buzz around the iPhone / AppStore etc, I felt
Good morning, afternoon, evening or night (depending on your timezone). This is just a
Good evening I've got a little problem with my DataGridView in a .NET Windows
Good Afternoon Gurus, I am pretty familiar with basic socket programming, and the IO::Socket
Good Afternoon All, I have a table inside a div. The div has a
Good afternoon. Before I begin my explanation, I have had a look at other
Good afternoon people's I have built a jquery plugin that I use on my
Good morning, I am about to start writing an Excel add-in for Excel 2002.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.