Tmpfs free space versus the "free" command

I've always thought this possible, so today I tried it:
I have 2 gigs of physical RAM, and no swap partitions, so my memory limit is a hard 2 gigs.
I made 2 1-gig tmpfs mounts; nothing complained.
I filled them up one at a time, and kept checking both free memory (with free) and free space on the tmpfs mounts -- as I started to get near the limit of my system's RAM, free still showed plenty of RAM free in the +/- row.
Neither free nor df gave me any indication that the system was dangerously low on memory. (I assume from a bit of Googling  that "free" considers the size of tmpfs's to be part of the "cached" column, as nothing else was big enough to contain them.)
Anyhow, I added a few more files to the tmpfs and the system locked up for a while... After about 3 minutes of hard drive thrashing (which was a bit distressing, but since my files look OK I guess it was desperately running sync again and again to try to free RAM for the tmpfs), a couple programs died and everything went back to normal.
So, in an effort to have that not happen again (since I use tmpfs heavily; it's a nice way to screw around with big files without waiting on hard drives), I wrote this little shell script:
#!/bin/bash
#prints worst-case free memory, from /proc/meminfo
total=`grep MemTotal /proc/meminfo | gawk '{print $2}'`
used=`grep Committed_AS /proc/meminfo | gawk '{print $2}'`
echo "Free RAM in the worst case: " $(($total - $used)) "kB"
and put this in my .bashrc:
alias free='free; wcfree'
alias df='df; wcfree'
~Felix.
PS: If it's not possible to make stuff crash with only a single tmpfs, please let me know -- that would be good knowledge, and make me feel silly for writing this :P

The advice I got was to shrink the database and reexpand it. And reindex all tables because of defragmentation.
I don't know if it works, and I would be hesitant to try it, because I believe there is an issue with DBCC SHRINKFILE being awfully slow when there is LOB data.
I like to believe that your odds would be better if you used varbinary(MAX), and given how easier varbinary(MAX) is to work with your life would be happier two. But I don't know how that would work with your merge-replication scheme. And if you use READ/WRITE/UPDATETEXT
you need to change that code.
You say you cannot create a new table and copy data over because of merge replication. Would it be possible to create a new column, copy data over, drop the old column and rename? I have no experience with merge replication myself, so I don't know of
the repercussions. If you do this, you need to run DBCC CLEANTABLE to get rid of the space.
For that matter you could try DBCC CLEANTABLE in the state you have now. Not that it should help from you have told me, but you never know...
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Insufficient free space in the database during upgrademodule General checks

    we are upgrading SAP R/3 Enterprise 470 110 to ECC6 on Oracle/Windows.
    During PREPARE module: General checks the file CHECKS.LOG show the following information:
       #====================================================#
    Requests and information for module General checks #
       #====================================================#
    INFO> The following values may be preliminary because of
          free space consumption during productive operation and
          additional free space requests derived in a later stage.
          Conversions of modified tables can require additional space.
          Please use the largest free space request printed,
          which are the values at the very end of this file.
    ERROR> Insufficient free space in the database as follows:
    Create TABLESPACE PSAPDIMD             with 102 MB
    Create TABLESPACE PSAPDIMI             with 102 MB
    Create TABLESPACE PSAPODSD             with 112 MB
    Create TABLESPACE PSAPODSI             with 112 MB
    Create TABLESPACE PSAPFACTD            with 102 MB
    Create TABLESPACE PSAPFACTI            with 102 MB
    INFO> To adjust the size of your tablespaces, you may use the commands
          in file 'C:\usr\sap\put\log\ORATBSXT.LST' using the 'brspace' utility.
          Please copy the file before making changes, as it may be
          overwritten in subsequent upgrade phases.
    INFO> During the upgrade, the new SAP kernel
          will be installed. All files and subdirectories
          in directory C:\usr\sap\CTD\SYS\exe\run which are not used
          in Release 700 will be removed.
          The files from "dbclient.lst" in the kernel directory are kept.
          Files and subdirectories can be protected from deletion
          if they appear in a file "protect.lst" in the same directory
          (each protected name in a separate line).
          For security reasons, directory C:\usr\sap\CTD\SYS\exe\run
          should be saved in a backup.
    INFO> You already installed kernel extensions.
          Please unpack the archive(s)
          RFC.CAR
          after the upgrade has finished.
          You can find these archives on the CD "Presentation".
          Do  n o t  unpack the archives now, the software
          is only compatible with the new SAP kernel.
    INFO> It is possible to upgrade the frontend software before
          you start SAPup!
       #===========================================================#
    PREPARE module General checks finished with status failed #
       #===========================================================#
    #====================================================
    Execution of all selected PREPARE modules finished.
    #====================================================
    Now, we have the new tablespace layout and as says the upgrade general note: Note 819655 - Add. info.: Upgrade to SAP NW 2004s ABAP ORACLE we do not have to create tablespaces as saied in PREPARE; so I have adjusted tables DDART,    TAORA, IAORA: with the entry
    DDIM     STD     Dimension Tables in BW
    DFACT     STD     Facts Table in BW
    DODS     STD     ODS Tables in BW
    Then J have repeated the module: GENERAL CHECK but in the file CHECKS.LOG I noted always the same error.
    Any HELPS?????
    Edited by: Raffaele Pezone on Dec 1, 2009 4:25 PM
    Edited by: Raffaele Pezone on Dec 1, 2009 4:34 PM

    As mentioned in sap note: Note 541542 - Upgrade phase INIT_CNTRANS: Container inconsistency
    we don't have standard layout:
    Standard layout: TABART: TAORA-TABSPACE, IAORA-TABSPACE
    SSDEF:  PSAPES<rel>D,   PSAPES<rel>I
    SSEXC:  PSAPES<rel>D,   PSAPES<rel>I
    SLDEF:  PSAPEL<rel>D,   PSAPEL<rel>I
    SLEXC:  PSAPEL<rel>D,   PSAPEL<rel>I
    APPL0:  PSAPSTABD,      PSAPSTABI
    USER :  PSAPUSER1D,     PSAPUSER1I
    <...>:  PSAP<.....>D,   PSAP<.....>I
    but
    MCOD Layout (new layout)
    SSDEF:  PSAP<sid><rel>, PSAP<sid><rel>
    SSEXC:  PSAP<sid><rel>, PSAP<sid><rel>
    SLDEF:  PSAP<sid><rel>, PSAP<sid><rel>
    SLEXC:  PSAP<sid><rel>, PSAP<sid><rel>
    APPL0:  PSAP<sid>USR,   PSAP<sid>USR
    USER :  PSAP<sid>USR,   PSAP<sid>USR
    <...>:  PSAP<sid>, PSAP<sid>
    but we don't use Multiple component in one Database. We have only one instance in one DB.
    in fact we have following tablespaces:
    PSAPSID   
    PSAPSID620
    PSAPSID700
    PSAPSIDUSR
    PSAPTEMP  
    PSAPUNDO  
    SYSAUX    
    SYSTEM
    I have just created PSAPSID700 as  PREPARE says.

  • WBAdmin BMR backup says "There is not enough free space on the backup storage location to back up the data."

    We're doing nightly BMR backups of a small 2012 R2 Hyper-V host via wbadmin to 2TB USB disks, via
      wbadmin start backup -backupTarget:z: -quiet -noverify -vssFull -include:e:,c: -allCritical
    (where E: contains the sole VM).
    We are using the same backup system on other similar Hyper-V hosts running 2008 R2 and 2012, with no problems. However, with this 2012 R2 host, after a few months of no problems the backups started failing with:
      There is not enough free space on the backup storage location to back up the data.
    This made no sense, and continues to make no sense:
    The 2TB backup disks are only half full (>1TB free), with 600GB of unallocated shadowstorage.
    There should be room for many more backups on these disks. Each currently contains 11 to 13 backups, with the initial full backup having required about 600GB and each subsequent backup only requiring another 20GB to 40GB.
    There is over 40GB free on the C: drive and 300GB free on the E: drive; free space on the host volumes is not an issue.
    Increasing the shadowstorage limit on the backup disks to unbounded doesn't resolve the issue.
    This is not a problem of a RECOVERY partition that's too small, and SystemState backups always complete successfully.
    The first workaround we found was to temporarily reduce (not increase) the shadowstorage allocation on the E: drive (containing the VM) and then increase it back (with the end result of deleting old shadow copies).
    This worked reliably, but looking for a root cause led us to uninstall the Windows Updates installed mid-September (in particular the Aug 2014 and Sep 2014 roll-ups), which preceded the start of this problem. But instead of resolving the problem the uninstalls
    made it worse, in that our workaround stopped working.
    We reinstalled the Windows Updates, and then tried setting backup performance to normal, in case the problem was related to VSS on the host volumes, but the errors continued.
    At this point the only way we've found to work around the error is to delete 1 or 2 of the oldest backups on the destination disk, via
      wbadmin delete backup -backupTarget:z: -deleteOldest
    after which the new backup will succeed.
    But, again, this makes no sense, as the destination disks are only half full, and even if space was an issue wbadmin should delete old backups as required. And this same system is working fine on 2008 R2 and 2012.
    Any suggestions?
    Thanks,
    John

    Hi John,
    Please check run the command below to check if the space required to complete the backup causes the snapshot storage space to become less than 1/8 of the target size.
    vssadmin list shadows /for=x: will list the shadow copies on x: and creation time.
    WSB will not shrink the diff area to less than 1/8 of Target volume size as we do not want to lose all past backups just to accommodate this one.
    For more detailed information, please refer to the article below:
    Windows Server Backup automatic disk usage management
    http://blogs.technet.com/b/filecab/archive/2011/03/14/windows-server-backup-automatic-disk-usage-management.aspx
    V. Backup, Restore and Disaster Recovery
    http://social.technet.microsoft.com/wiki/contents/articles/1846.v-backup-restore-and-disaster-recovery.aspx?Sort=MostUseful&PageIndex=1
    Best Regards,
    Mandy 
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Ut 4000 photos in my iphotos; iPhoto cannot import your photos because there is not enough free space on the volume containing your iPhoto library.

    I keep getting the following error message despite only having about 4000 pics in my iphotos; iPhoto cannot import your photos because there is not enough free space on the volume containing your iPhoto library. I have tried moving my iphotos library to an external Hard Drive and starting a new library but still it will not allow any more to be loaded.

    What version of iPhoto?
    try Back up your iPhoto library, Depress and hold the option (alt) and command keys and launch iPhoto - rebuild your iPhoto library database
    LN

  • Why am i getting this warning? iPhoto cannot import your photos because there is not enough free space on the volume containing your iPhoto library.

    I can no longer import photos from my PC because I get this message:  iPhoto cannot import your photos because there is not enough free space on the volume containing your iPhoto library.  How can I fix this problem?

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • I have IPhoto version 9.5.1. I cannot export pictures, the following message appears: "iPhoto cannot import your photos because there is not enough free space on the volume containing your iPhoto library." What am I suppose to do? I have a Mac mini.

    I have IPhoto version 9.5.1. I cannot export pictures since the following message appears: "iPhoto cannot import your photos because there is not enough free space on the volume containing your iPhoto library." What am I suppose to do? I have a Mac mini which properly used can perform any reasonable task, the problem is I do not know what to do.
    Any help will be appreciated.

    Hmm... that was labelled:
    As a Test:
    In bold and all
    Try repair the main Library:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • Hi,  I was wondering if someone can help me. I have a MacBook Pro, it has came up saying I need to free up space on the disk as it full every time it starts up, so I log in and no icons or applications show up on the screen just my background wallpaper, t

    Hi,
    I was wondering if someone can help me. I have a MacBook Pro, it has came up saying I need to free up space on the disk as it full every time it starts up, so I log in and no icons or applications show up on the screen just my background wallpaper, the only thing I can do is the force quit keyboard shortcut but there is nothing to quit, I have tried to start up in safe mode but again there is no icons in the desktop,
    I have my disks that came with my laptop I have went into disk utility to repair disk and I still seem to have the same problem .. No icons or apps or anything lol just the cursor I can only shut down the laptop via power but and the press shut down.
    Please help I am going out my mind with this thing :(
    Thanks x jade

    This can be used to boot the machine and delelte enough files to get it to boot normally.
    .Create a data recovery/undelete external boot drive
    Read about storage drive so you can store your extra stuff.
    Most commonly used backup methods
    Also here to see how a full boot drive slows the machine down
    Why is my computer slow?

  • I recently upgraded to an iPhone 5 and I have this synced with my previous iCloud account. My problem is my old iPhone 4 is taking up 2.5 GB of space in the cloud. Is there a way to delete this iphone from the icloud so I can free up space?

    I recently upgraded to an iPhone 5 and I have this synced with my previous iCloud account. My problem is my old iPhone 4 is taking up 2.5 GB of space in the cloud. Is there a way to delete this iphone from the icloud so I can free up space as it is not needed anymore?

    Welcome to the Apple Community.
    Assuming you have finished with your old backup.....
    You can see what your iCloud storage is used for and delete any unwanted content at settings > iCloud > backup & storage > manage......

  • I have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk?

    i have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk through disk utilities without erasing data (but will it delete my programs such as photoshop, office, creative suite?

    Connect the computer to another Mac and put it in FireWire Target Disk mode, or use the Disk Utility to clone the drive or image specific folders with the USB drive as the target. After you've copied off everything you want, you'll likely need to erase the drive and reinstall the applications.
    (69695)

  • No way to free space in the internal hard disk.

    Hi guy
    There's no way to free any space in the internal hard disk. If I throw 5 giga of files in the trash and empty it, I don't find 5 more giga of avalaible space in the internal hard disk. Time Machine is not activated. Any idea to solve the problem? Sorry for my english....

    Freeing Up Space on The Hard Drive
      1. See Lion/Mountain Lion/Mavericks' Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Also see Freeing space on your Mac OS X startup disk.
      5. See Where did my Disk Space go?.
      6. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
    Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located.

  • HT1923 hi, my mac air is really low on disk space, can i remove iTunes (which is huge) to an external hard drive to free up space and then just run it from the hard drive. instead of taking space on the mac? even if the mac no longer has enough to accommo

    Hi, my mac air is really low on disk space, can I remove itunes (which is huge) to an external hard drive to free up space?...and then run it from the hard drive instead of the mac,even if the mac no longer has space to accomodate the size of the library?

    Yes.
    Copy your music iTunes Library folder to the external drive and change the Advanced settings in iTunes to point to this new location.
    Once you're happy with these changes you can delete the same Library from your User account to free up space on the internal drive.

  • When I am importing photos from DVD rom, iPhoto shows " not enough free space on the volume containing your iPhoto library", but i have over 200G free in hard drive? how do i fix it?

    Mac Pro Book
    Mac OS X 10.7.5
    iPhoto 11 9.4.2
    importing photos into iphoto, shows "Photo cannot import your photos because there is not enough free space on the volume containing your iPhoto library."
    tried creat new library, same thing.
    currently only has 2,500 photos in iPhoto
    Importing about 500 photos, but cant do it due to the message showed above.
    Who knows how to fix it?

    How much free space do you have on your hard drive?  Try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iPhoto folder (Snow Leopard and Earlier).
    or with Mt. Lion from the User/Library/Containers/com.apple.iPhoto/
    Data/Library/Caches/com.apple.iPhoto folder
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    NOTE 2:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.

  • Treo 755p The free data storage space on the device is low. Some data could not be saved

    After having the Treo 755p device for only a week, I am receiving a message "The free data storage space on the device is low. Some data could not be saved."  I have over 55 mb of free space according to the device info page. I cannot find anything about this in the knowledge library, can anyone offer help?
    Post relates to: Treo 755p (Sprint)
    Post relates to: Treo 755p (Sprint)

    My problems are similar to Lauren, but backwards.  For months now I have had problems with my Treo 755 reseting randomly.  Sometimes during calls, sometimes while typing, sometimes while just sitting in the holster.   As many as a dozen a day and then not at all for 2 weeks, no rhyme nor reason.  This Free Space error though is brand new to me today and quite strange.   The error is showing up when I bring my phone out of "sleep".  I press the end button to sleep the phone and everything is fine.  When I press it again to wake the phone up the error is sitting behind the keylock waiting for me.
    Obviously I have done nothing yet for this new memory error, but I've tried everything for the reseting.  Deleting software, Soft and hard resets, software updates, everything I and Sprint support can think of.  With this new Free space error now I am going to just take it to a service center and demand a new phone.  I think there is some kind of hardware error as I have done nothing in the programming.  No new programs, no deleted programs, no changed settings.
    I loved my Treo 650 and never had any problems with it.  I am getting very disappointed in Palm now though with these ridiculous problems. 
    Post relates to: Treo 755p (Sprint)

  • HT201364 When I try to download this I get a message that says I haven't got sufficient space on my startup disk. I have checked my available space on the disc and I have only 3GB free out of 500. I have hardly anything on my mac - how can this be?

    When I try to download this I get a message that says I haven't got sufficient space on my startup disk. I have checked my available space on the disc and I have only 3GB free out of 500. I have hardly anything on my mac - how can this be?

    Freeing Up Space on The Hard Drive
      1. See Lion/Mountain Lion's Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Also see Freeing space on your Mac OS X startup disk.
      5. See Where did my Disk Space go?.
      6. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
    Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located.

  • Adobe Premiere Pro cs5 has eaten a free space on the hard drive!

    The initial video file was about 1Gb, I needed to cut it and add audio to it. I tried exporting with DV PAL encoding, there was about 15Gb of free space on the hard drive. It took a long time to export and somewhere at 90% it showed the message that free space on the drive was out. I closed Premiere, the target directory where encoded AVI should be exported was empty. The search by name doesn't find anything. Disk cleanup freed only 5Gb. Could you please tell me what the directory where Premiere store a temporary files while Encoding Sequence.
    THANKS IN ADVANCE!

    Hello, I have a very similar problem.  A few days ago I was alarmed to see all of a sudden my Main Hard Drive full. 
    The editing station that I'm working on is a new computer and all media and scratch disks are assigned to a project folder on another hard drive.
    I started digging through the main drive to find what is loading the drive and realized that Media Cache files folder has over 30 Gigabytes of data in it!
    In the Adobe Premiere Media Settings there is an option to redirect the Cache files or Save them next to originals check box (Which I selected).
    This brings me to very important questions:
    What is the correct process of setting up Adobe Premiere project so there are no temporary, cache, pre-renders.... clog up the main drive or get scattered elsewhere? It would be very preferable to keep everything in one project folder.
    Should I redirect or keep the files with originals?
    Besides Scratch disks and Media Cache files are there any other files generated by the program?   If there is, where can I find them?
    Once I complete my project and want to completely delete it from my computer, what is the correct way of removing everything so nothing is left over from the deleted project?
    Answers to these questions are very important for me and I would be very grateful to get answers to them :-)

Maybe you are looking for

  • Price updation in Material Master after confirmation

    Dear Gurus, When we create a production order for Semi finished which is maintained with Moving Average Price(MAP) in material master and we do confirmation of the order with "CO15'. My client wants after goods receipts against 101 movement type the

  • ERROR : - LOADING TO APPLICATION SERVER

    Hi, experts.............. can u please chk this code once what is the mistake in it. iam not in a position to upload to application server. TABLES : KNA1. data : begin of it_upload occurs 0,        kunnr like kna1-kunnr,        name1 like kna1-name1,

  • Adobe support is terrible.  Need a telephone number

    I have an issue that I have not been able to solve via the chat support.   They are terrible!!!!   Is there a support number available?

  • Excise reports using XL reporter

    Hello experts                      I generated Excise reports using files available in Indian  legal reports.How can we get drill down facility in these reports? Regards Manoj

  • Can't load iCloudPrefPane

    Process:           com.apple.preferences.icloud.remoteservice [2606] Path:              /System/Library/PreferencePanes/iCloudPref.prefPane/Contents/XPCServices/com.app le.preferences.icloud.remoteservice.xpc/Contents/MacOS/com.apple.preferences.icl