Memory mapped files Are they still used.

To System  programmers.
In some of my old code David used memory mapped files in handling huge sets of random points.  The code reads in the whole file and then sets flags similar to an async process.  The filemapping handles memory instead of using mallocs.  the
data maybe stored on the heap or in hte global stack.  I went back to Viusal Studio 6 and tried to take out the code as the standard c++ handles a full file read as a char buffer as a void * structure.  I found some valloc data types and
then found the newer filemapping routines in VS2013. Plus an explanation of global stack and heap.
Are software developers using file mapping or are they using say vectors to form stl structures.
Cheers
John Keays
John Keays

Here is some typical code in the old C.  This is close to the code I used in Visual studio 6.  I need to put this in vs2013 under c++ or C++ 11/14.  I have guessed the file handle open and size code.
main{
int fsize, numRecords;
Point *allPoints;
 fsize = readAllFile(name, &allPoints);
numRecords = fsize/ sizeof(Point);
for (i=0; i < numRecords:; I++)  printf("rec %d values x %.3f\n", i, allPoints[i].x);
int
readAllFile(char*name, void **addr){
file *fh;
int fsize;
openf(fh, name);
fsize = getfilesize(fh);
*addr = malloc(sizeof(char)*fsize);
fclose(fh);
return fsize;
This is the boilerplate for the file reads.  Even tried this with text files and parsing the text records.  Instead of the mallocs you suggest vector and the scheme of the code remains the same.
For a lidar file the xyz records have grown from 10,000 in the 1990's to 1,000,000 points in the mid 2000's.  For this size file 24 M bytes are allocated in one hit.  The whole of the Gold Coast in terms of lidar points in 2003 was 110 million
points.  It could be more.
Where is the data stored in the Malloc, Vector or memory Mapped file.  What is good and bad practice.
Cheers
john Keays
John Keays

Similar Messages

  • Hr tag in HTML, are they still used.....?

    It seems you can create the same effect by using certain css styles, just wondering is it advisable to use them...?
    Are they compatible in dreamweaver...?

    I cant see any reason why not.
    http://www.w3schools.com/tags/tag_hr.asp states:
    "The hr element can be used to separate content in an HTML page."
    http://www.w3schools.com/html5/tag_hr.asp says:
    "The <hr> tag inserts a horizontal rule, which should define a thematic change  in the content."
    Seems like there's a slight change in emphasis in the purpose but in HTML 4 XHTML and HTML 5 the element is valid and has a purpose.
    Martin

  • After deleting photos, memory in my iPad is still used. WHY?

    When connecting my iPad mini to iTunes on my MacBook Air it shows that I have 2489 pictures on the iPad and am using 28.4 GB for all those pictures. When I open the Photos app on my iPad it shows that I do not have ANY pictures on the iPad, which would be correct, as I have deleted them all. So why are they still using up all that memory? How can I clear the memory to make it available again? BTW, My iPad Settings>General>About agrees with iTunes. It shows that I have 2452 pix (why not 2489 as above?), and am using 28.4 GB for them. So again, HOW CAN I CLEAR THE UNUSED MEMORY, or get rid of the pix if they are indeed still hiding somewhere on my iPad?
    My iPad mini is running iOS 8.1.1
    Thanks for any help....

    Hi, Tahunga,
    May be you need to do a comprehensive first.
    Firstly, be aware that the phone can sometimes take a while to update free space after deleting large items. I have often wondered whether iOS is making the user experience a bit 'nicer' by reporting the item deleted instantly, while doing the actual deleting in the background. Or perhaps its just the time taken to update databases used to record/report used/free space. In any case, try giving it a few minutes (maybe an hour) and see if its 'settled down'.
    Next up, in the Photos app, check the albums 'tab'. Is the camera roll reporting entirely empty? Are there any other albums?
    Finally, plug the iPad into your computer, and open up an app like Apple's Image Capture or whatever you use on Windows/Mac/Linux to import photos from a camera. Check that there's actually no photos in the 'camera' that is your iPad. After clearing out my pad, I found a bunch of small, unreadable movie files and a few photos left over in this app. I don't know how or why, given the iPhone wasn't showing them, but they were clearly taking up space. You may have somehow ended up with a lot of these.

  • Nio ByteBuffer and memory-mapped file size limitation

    I have a question/issue regarding ByteBuffer and memory-mapped file size limitations. I recently started using NIO FileChannels and ByteBuffers to store and process buffers of binary data. Until now, the maximum individual ByteBuffer/memory-mapped file size I have needed to process was around 80MB.
    However, I need to now begin processing larger buffers of binary data from a new source. Initial testing with buffer sizes above 100MB result in IOExceptions (java.lang.OutOfMemoryError: Map failed).
    I am using 32bit Windows XP; 2GB of memory (typically 1.3 to 1.5GB free); Java version 1.6.0_03; with -Xmx set to 1280m. Decreasing the Java heap max size down 768m does result in the ability to memory map larger buffers to files, but never bigger than roughly 500MB. However, the application that uses this code contains other components that require the -xMx option to be set to 1280.
    The following simple code segment executed by itself will produce the IOException for me when executed using -Xmx1280m. If I use -Xmx768m, I can increase the buffer size up to around 300MB, but never to a size that I would think I could map.
    try
    String mapFile = "C:/temp/" + UUID.randomUUID().toString() + ".tmp";
    FileChannel rwChan = new RandomAccessFile( mapFile, "rw").getChannel();
    ByteBuffer byteBuffer = rwChan.map( FileChannel.MapMode.READ_WRITE,
    0, 100000000 );
    rwChan.close();
    catch( Exception e )
    e.printStackTrace();
    I am hoping that someone can shed some light on the factors that affect the amount of data that may be memory mapped to/in a file at one time. I have investigated this for some time now and based on my understanding of how memory mapped files are supposed to work, I would think that I could map ByteBuffers to files larger than 500MB. I believe that address space plays a role, but I admittedly am no OS address space expert.
    Thanks in advance for any input.
    Regards- KJ

    See the workaround in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4724038

  • "can't load because some files are already in use" - Adobe reader!  How do i close whatever i can't find that they say is in use!?

    Can anyone help me get Adobe reader 11 installed??? The error message when I'm practically done says the file can't be loaded because some files are already in use - and it refers to Adobe reader!  What do I do to get past this??? Help!  I need to install adobe!
    I had been having a problem after I tried to do an adobe update, so i deleted and tried to reinstall the program and it won't let me ! Any suggestions???

    Hi Jody414,
    Use the Acrobat Cleaner tool ( Download Adobe Reader and Acrobat Cleaner Tool - Adobe Labs ) to remove Reader completely from the machine.
    Download Reader 11 from: Adobe - Adobe Reader Distribution   and install and check.
    Regards,
    Rave

  • Error code 1450 - memory mapped file

    Hello,
    in my application I am using memory mapped files. I have three of it, the maximum size of the biggest one is 5MB. I store 64 Waveforms from a DAQ card in it. 
    The application runs fine, but sometimes comes an error, when I try to access the MMF. The error code is 1450, "insufficient system resources"
    Is a size of 5MB too big? Should I rather create one MMF for each waveform?

    Hi mitulatbati,
    which development tools are you actually using?
    Which platform, libraries and so on...?
    Can you post example code?
    Marco Brauner NIG 

  • Memory-mapped file is possible?

    Hi everyone, I'm a new Labview user and I want to start a new project that uses Memory mapped file.
    I have a working C# code to read the $gtr2$ MMF, where i simple use 
    MemoryMappedFile.OpenExisting("$gtr2$")
    to get data from it.
    How it is  possible to read this kind of file in labview? I can't find anything useful on the web.
    I'm using a LabVIEW 2013 student edition.
    Thanks to everyone who wants to answer my question.
    Have a nice day.

    Hi,
    I too only have done the CLAD…
    You have to look for DotNet examples, you will find them here in the forum…
    And usually it helps to read the documentation for that MMF class to recreate your C++ code in LabVIEW!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Memory mapped files

    Does anyone know if there is any way to use memory mapped files in Java? If so, what are the calls that emulate the C++ calls to CreateFileMapping() MapViewOfFile() and OpenFileMapping()?

    http://java.sun.com/j2se/1.4.1/docs/api/java/nio/MappedByteBuffer.html

  • CFS and memory mapped file

    I would like to know if it is possible to memory map (mmap) a file that is residing on a cluster file system (CFS or GFS).
    If I remember correctly, memory mapping a file residing on NFS has issues.
    Thanks,
    Harsh

    I'm using SC 3.1u4 on Solaris 9. I ran in to a problem with memory mapped files on CFS.
    I've multiple processes (on one cluster node) sharing such a file that was created using the following command:
    mmap ((caddr_t)0,SOME_SIZE,(PROT_READ | PROT_WRITE), (MAP_SHARED | MAP_NORESERVE),fd,0);
    Issuing msync with MS_INVALIDATE as the third argument is ok. But when some other process tries to read the memory the node seems to hang.
    I can't examine the processes using pstack or truss as both of them get hung too. Only way out of this mess is to reboot the node.
    I can't imagine this problem hasn't been seen before. Is there a patch for it?

  • Cool ideas are they still around ?

    Remembering N8
    Cool ideas are they still around ? 
    Options
    https://www.youtube.com/watch?v=ZOJ2QSioTA0&index=14&list=LL6***bleep***TD-56vVTh2iC3DTzmHQ
    https://www.youtube.com/watch?v=IX-gTobCJHs&list=LL6***bleep***TD-56vVTh2iC3DTzmHQ&index=15
    We got glance now, but this was way cooler and didn't drain the battery
    https://www.youtube.com/watch?v=yE5pLjrivP8&list=LL6***bleep***TD-56vVTh2iC3DTzmHQ&index=7
    https://www.youtube.com/watch?v=OUJIb46Xy7Y
    This could be a cool solution ever.
    https://www.youtube.com/watch?v=solfTOEl_Hg
    The coolest phone ever would have been N8 with 4GB processor , 64GB memory and 60 MP camera... sold for $400.-500
    if we had all of this in Symbian and WP is still catching up was Symbian dead ?
    KR
    KR

    So you are saying Microsoft should provide each and every function users can come up with and it's no good if 3rd party developers imlement such features? It would seem to me you are the one who is not getting the whole concept of modern day smartphone OS development as we see it today. Apps are an integral part of the whole system and it's not the responsibility of the OS developer to cram each and every little feature anyone wants into the core OS.
    Why don't you talk to the developers of an app like volume, tell them you like what you see and that you would think it would be cool if their apps does so-and-so.. This is a user-to-user discussion platform and not a 'talk to Microsoft' forum.
    While I get that SYmbian may have has some features some would like to see in their current OS that is not what this is about. I would LOVE to see Windows do things which I could do with Amiga OS back in the day but is that going to happen? I am guessing not ever..
    Click on the blue Star Icon below if my advice has helped you or press the 'Accept As Solution' link if I solved your problem..

  • An hour ago, I accidentally deleted a "Bookmarks" folder, and all of subfolders and hyperlinks. The lost items are not in "Trash." Are they still retrievable? JAW

    An hour ago, I accidentally deleted a Bookmarks folder, and all of subfolders and hyperlinks. The lost items are not in "Trash." Are they still retrievable? JAW

    They don't go into the Trash. Unless you have a backup prior to the deletion time it's gone.

  • If using wi-fi are you still using part of $15 att plan?

    If using wi-fi are you still using part of $15 att plan?

    No.  You would be using wi-fi.
    the $15 plan is for AT&T's cellular data network.
    Visual Voicemail, however, does use cellular network.

  • My ipad2 was stolen today and I was not able to wipe it remotely.  Apple deauthorized it but since I had a bunch of apps on there, are they still accessible?

      Apple deauthorized it but since I had a bunch of apps on there, are they still accessible?

    Check out this thread...  https://discussions.apple.com/message/12060224?messageID=12060224
    Your apps are stored in your iTunes Library on your computer. If you recover the iPad or purchase a new one just re sync your apps / music etc.

  • I've reported my phone lost if some one finds it and is able to unlock the phone can they still use it thru wifi?

    reported my iphone lost if lost if someone finds it and is able to unlock it can they still use its wifi features ?

    Just in case....go to icloud.com/#find and see if your phone shows up.
    If it doesn't, there is nothing you can do to prevent someone else from using it if they know the passcode. That means it's time to start changing any and all passwords you have for websites & apps.
    ~Lyssa

  • My kids are on my email account.  I want them to now have their own accounts.  Can they still use all of my music and apps?

    I have my kids' iPods on my account.  I want to put them on their own accounts.  Is there a way I can do this without having them lose all of the stuff on my account?  And can they still sync things that I download if they're using my computer?

    Welcome to the Apple Community.
    If your children are under 13, you should open 2 new accounts for yourself and let them use it. They can use these ID's for iCloud and so have their own email! contacts! calendars etc, but still share your original ID for iTunes for apps, music, etc. You can continue to sync them with your computer.

Maybe you are looking for

  • Your Computer was restarted because of a problem

    Hi, I got a Macbook pro last year and it was working fine until a few months back the model is an old A1150 and I am getting this problem. Everytime I turn on the computer it restart by itself after that it works fine and I get this error. I have rep

  • Satellite L675 is locked in a loop of "configuring system"

    I have a Satellite L675 pre-loaded with Windows7 64-bit, because it was very slow so I decided to recovere it to the factory default out-of-box. But it has now been locked in a loop of "configuring system" with several reboots for more than an hour -

  • Notification from iCloud?

    I just received an email from iCloud that says I have to update my account info. It wants all of my secure info. Is this legit or a scam?? Wondering if others got this email.

  • I rented a movie in iTunes

    Okay so, I rented a movie with iTunes and I can watch the first 35 minutes and then I can't watch any more of it. Please help! Thanks a lot

  • Webdynpro Applications Transport

    Hello All, I have deployed all my Webdynpro applications in Development and Quality, now I want to transport all my applications to Production and I dont know how can I do it? Thanks in advance Alexis Ramirez