`
oliver_peng
  • 浏览: 44846 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Copy file without using cached memory

阅读更多
By default, Linux always cache the file which you just copied. But sometimes you don't want Linux to keep file pages in memory, for example when you copy a big disk image file and never use it again.

To copy file without using cache memory, you can use dd command and here is the sample:

dd iflag=direct,nonblock if=b_1_GB_file bs=64k oflag=direct,nonblock of=b_1_GB_file.backup

In fact, dd command create a pipe between file b_1_GB_file and b_1_GB_file.backup and dump all data from file b_1_GB_file to b_1_GB_file.backup.

Recently I have a problem is that MySQL can't start after I backup the big InnoDB database file to another directory. Here is the error message:

090603 16:10:08  InnoDB: Error: cannot allocate 2147500032 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 23965696 bytes. Operating system errno: 12
InnoDB: Check if you should increase the swap file or
InnoDB: ulimits of your operating system.
InnoDB: On FreeBSD check you have compiled the OS with
InnoDB: a big enough maximum process size.
InnoDB: Note that in most 32-bit computers the process
InnoDB: memory space is limited to 2 GB or 4 GB.
InnoDB: We keep retrying the allocation for 60 seconds...
InnoDB: Fatal error: cannot allocate the memory for the buffer pool

Here is the memory status:

free -m
             total       used       free     shared    buffers     cached
Mem:          3287       3140        146          0          4       3013
-/+ buffers/cache:        122       3165
Swap:         4094          0       4094

So at that time, Linux is using 3G memory for cache and reject MySQL's request for allocating 2G memory. Of course, this is a bug. To work around this, you can run following command to release cached memory manually:

sync; echo 3 > /proc/sys/vm/drop_caches
分享到:
评论

相关推荐

    uhdd.sys源码

    using its B switch first boots in temporary space When upper memory gets enabled by the EMM driver XMGR loads there with no B copies all its boot data and takes over XMS work For a small XMS only ...

    BURNINTEST--硬件检测工具

    if the test was run a couple of times (without closing BurnInTest). Release 5.3 build 1021 WIN32 release 5 June 2008 - 32-bit BurnInTest PRO 5.3.1020 would not start on Windows 2000. This has been ...

    应用Dephi 开发佳能照相机API

    When using the EDSDK libraries, you must call this API once before using EDSDK APIs. Parameters: In: None Out: None Returns: Returns EDS_ERR_OK if successful. In other cases, see EDSDKError....

    acpi控制笔记本风扇转速

    Moved all FADT-related functions to a new file, tbfadt.c. Eliminated the AcpiHwInitialize function - the FADT registers are now validated when the table is loaded. Added two new warnings during FADT ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    Added TFlexFileFormat.StreamSupport property (default True), which difines, is it necessary to open file stream or give the file name only. - FIX: If the TCustomProp.Assign method calls when the ...

Global site tag (gtag.js) - Google Analytics