qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Memory: how to determine the max memory size of one VM?


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Memory: how to determine the max memory size of one VM?
Date: Fri, 10 Feb 2012 11:31:53 +0000

On Fri, Feb 10, 2012 at 11:23 AM, Zhi Yong Wu <address@hidden> wrote:
> On Fri, Feb 10, 2012 at 7:10 PM, Stefan Hajnoczi <address@hidden> wrote:
>> On Fri, Feb 10, 2012 at 11:00 AM, Zhi Yong Wu <address@hidden> wrote:
>>> On Fri, Feb 10, 2012 at 6:35 PM, Stefan Hajnoczi <address@hidden> wrote:
>>>> On Fri, Feb 10, 2012 at 9:47 AM, Zhi Yong Wu <address@hidden> wrote:
>>>>> Today i tried to create one VM with the option "-m 4000", and found it
>>>>> failed with the following errors:
>>>>>
>>>>> Failed to allocate 4194304000 B: Cannot allocate memory
>>>>> Aborted (core dumped)
>>>>
>>>> Did you run on a 32-bit host?
>>> No, it is one x86_64 host.
>>
>> That is weird.  Have you tried strace(1) to find out which system call
>> is failing and why?
> It seems that it failed to call mmap().  ENOMEM
>
> mprotect(0x7fdd5f973000, 4096, PROT_NONE) = 0
> clone(child_stack=0x7fdd60172eb0,
> flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
> parent_tidptr=0x7fdd601739d0, tls=0x7fdd60173700,
> child_tidptr=0x7fdd601739d0) = 25488
> rt_sigprocmask(SIG_SETMASK, [BUS ALRM IO RT_6], NULL, 8) = 0
> select(11, [10], [], NULL, NULL)        = 1 (in [10])
> read(10, "\0", 16)                      = 1
> close(9)                                = 0
> open("/home/zwu/work/misc/rh6.img", O_RDONLY|O_NONBLOCK) = 9
> fstat(9, {st_mode=S_IFREG|0644, st_size=1396244480, ...}) = 0
> close(9)                                = 0
> open("/home/zwu/work/misc/rh6.img", O_RDONLY|O_NONBLOCK) = 9
> fstat(9, {st_mode=S_IFREG|0644, st_size=1396244480, ...}) = 0
> close(9)                                = 0
> stat("/home/zwu/work/misc/rh6.img", {st_mode=S_IFREG|0644,
> st_size=1396244480, ...}) = 0
> open("/home/zwu/work/misc/rh6.img", O_RDWR|O_DSYNC|O_CLOEXEC) = 9
> lseek(9, 0, SEEK_END)                   = 1396244480
> futex(0x7fdd67c6e724, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7fdd67c6e720,
> {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
> select(11, [10], [], NULL, NULL)        = 1 (in [10])
> read(10, "\0", 16)                      = 1
> lseek(9, 0, SEEK_END)                   = 1396244480
> mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
> -1, 0) = 0x7fdd670d1000
> write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
> rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [BUS ALRM IO RT_6], 8) = 0
> mmap(NULL, 8392704, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fdd5f172000
> mprotect(0x7fdd5f172000, 4096, PROT_NONE) = 0
> clone(child_stack=0x7fdd5f971eb0,
> flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
> parent_tidptr=0x7fdd5f9729d0, tls=0x7fdd5f972700,
> child_tidptr=0x7fdd5f9729d0) = 25489
> rt_sigprocmask(SIG_SETMASK, [BUS ALRM IO RT_6], NULL, 8) = 0
> select(11, [10], [], NULL, NULL)        = 1 (in [10])
> read(10, "\0", 16)                      = 1
> write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
> brk(0)                                  = 0x7fdd68f1a000
> brk(0x7fdd68f3b000)                     = 0x7fdd68f3b000
> open("/proc/meminfo", O_RDONLY)         = 12
> fstat(12, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
> 0) = 0x7fdd67243000
> read(12, "MemTotal:        2019156 kB\nMemF"..., 1024) = 1024
> close(12)                               = 0
> munmap(0x7fdd67243000, 4096)            = 0
> getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=4*1024}) = 0
> gettid()                                = 25462
> rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [BUS ALRM IO RT_6], 8) = 0
> mmap(NULL, 8392704, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fdd5e971000
> mprotect(0x7fdd5e971000, 4096, PROT_NONE) = 0
> clone(child_stack=0x7fdd5f170eb0,
> flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
> parent_tidptr=0x7fdd5f1719d0, tls=0x7fdd5f171700,
> child_tidptr=0x7fdd5f1719d0) = 25490
> rt_sigprocmask(SIG_SETMASK, [BUS ALRM IO RT_6], NULL, 8) = 0
> futex(0x7fdd67c8efc4, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
> mmap(NULL, 4196405248, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
> brk(0)                                  = 0x7fdd68f3b000
> brk(0x7fde63158000)                     = 0x7fdd68f3b000
> mmap(NULL, 4196536320, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
> mmap(NULL, 134217728, PROT_NONE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7fdd50000000
> munmap(0x7fdd54000000, 67108864)        = 0
> mprotect(0x7fdd50000000, 135168, PROT_READ|PROT_WRITE) = 0
> mmap(NULL, 4196405248, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)

I suggest checking the following:
$ free -m
$ cat /proc/sys/vm/overcommit_memory

See also http://www.kernel.org/doc/Documentation/sysctl/vm.txt.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]