Skip to contentSkip to conversation

maximum memory size allocated by _xmalloc

DISCUSSION Chulmin Kim 1 participant 1 message Jul 12, 2012

lore
Share & tools
lore
#0 lore raw
Quoted 48 lines · Chulmin Kim
Quoted 34 lines
Quoted 15 lines · Chulmin Kim
Quoted 14 lines

Hi all,

I'm currently inserting my own code to adjust the several existing memory ballooning works.

To accomplish it, I manage some kind of statistics in Xen memory area.

Using _xmalloc, I've allocated certain size of memory chunk for the data structure. ( I varied it from 10kb to 24 MB.)

When the size is equal to 24 MB, xen won't boot anymore. (stuck during the xmalloc, according to my debugging. _xmalloc returns NULL.) There was no problem when the size is below 12MB.

Quoted 7 lines
Quoted 5 lines

Is there any limitation such as max memory size for _xmalloc?

I suspected xen heap size, but, it is no longer adjustable. Right?

I hope somebody can give me a clue. Thanks.

_xmalloc will first try to use the size pools for allocation, and failing

that, try to

Quoted 4 lines

allocate full pages.

As it is returning NULL, this probably means you no longer have 24MB of

free

Quoted 4 lines

contiguous RAM to allocate.

~Andrew

Thanks for the reply, Andrew.

Quoted 8 lines

I have to check the contiguity.

If it is the cause of the problem, then, how can I detour this problem?

Other xen part calling xmalloc_array does not handle this problem as far as I know. (only consider it as an error)

Should I split the data structure into two or more chunks?

Personally, I would think that 24M is a stupidly large amount to be trying to allocate with xmalloc and friends.

Quoted 6 lines

If you are using that much memory, it might be worth using alloc_xenheap_pages() and working with full pages instead.

Why do you need so much space for memory statistics?

~Andrew

OK. I will try alloc_xenheap_pages().
But, isn't xmalloc (and its friends) already using alloc_xenheap_pages()?

I am following up a research work (Dynamic Memory Balncing ~~), and it maintains a table which has an entry per page in the machine.

My machine has large memory (different from that in the research work), so it needs that amount of memory.

Thanks!

Quoted 4 lines

--
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com