Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6042637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:48:45+00:00 2026-05-23T06:48:45+00:00

I have a problem loading a kernel module, there is a large data structure,

  • 0

I have a problem loading a kernel module, there is a large data structure, around the size of 2Gb of memory – whether I preallocate the table (so that it shows in .bss when I do size -A module.ko or try to vmalloc() it at load time, the module loading fails with insmod: error inserting 'module.ko': -1 Cannot allocate memory.

I tried debugging the problem on usermode linux, but I get a bunch of segfaults (that can be continued in gdb, but end up with a console message overflow in relocation type 10 val <value in the ball park of 6G> and 'module' likely not compiled with -mcmodel=kernel. I assume that with Kbuild the -mcmodel should be right, right?

So the questions are:

  1. Is there a generic 2G limit for linux kernel module size?
  2. Is there a specific 2G limit for kernel modules in usernode linux (I think that in past I’ve noticed that a large kernel module needs a clean, continuous block of memory…)
  3. Can I specify -mcmodel=large for a kernel module and expect it to work?

I’ve tried this on debian squeeze, 64-bit, 2.6.32-5-amd64 (host) with 8Gb of memory and 2.6.32 in uml with 4G memory, so this should not be an ordinary out of memory problem.

Extra credit for working around the limit, if such limit exists 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:48:45+00:00Added an answer on May 23, 2026 at 6:48 am

    If I define the table as static – the module loading will indeed fail – this is probably because of the 1.5G limit mentioned in the answer by Andrew Aylett

    However, if I do dynamic vmalloc() calls, I was able to get up to 7680Mb on a host with 8Gb of memory (until the kernel killed some crucial process and my X hanged).

    So to answer my questions:

    1. Yes, but only for data that is compiled in as static
    2. Doesn’t look like it.
    3. There is no need to do that.

    Extra credit: just do vmalloc()

    This only works in linux kernels newer than 2.6.10 – before that, the vmalloc() limit was 64 Mb.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have have a problem loading and accessing data from a value object in
I have problem when I try insert some data to Informix TEXT column via
I have problem with loading images from the Documents folder of iPhone application into
I have problem with loading resources for UserControl from referenced assembly in Expression Blend
related Questions didn't help ! i have a problem loading php_curl.dll under following circumstances:
I have this huge problem with memory management. The problem : I've got a
I have a problem with loading the hpricot gem. I'm using it in a
I'm new to rails and testing and have a problem with loading my fixtures.
I have problem with loading my jqGrid. It just loads two parallel lines, and
I have a problem loading css with ajax, when I execute ajax in explorer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.