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

  • SEARCH
  • Home
  • 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 9129691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:48:23+00:00 2026-06-17T07:48:23+00:00

My full C MATE applet can be found at github here: https://github.com/geniass/mate-resource-applet/tree/cmake (BRANCH CMAKE).

  • 0

My full C MATE applet can be found at github here: https://github.com/geniass/mate-resource-applet/tree/cmake (BRANCH CMAKE). It’s a hacky mess right now, so see the code below.

I couldn’t find an applet to display my computer’s free ram, so that’s basically what this is. I am using sysinfo to get this information, and it works fine for my system’s total ram (roughly 4GB, it shows 3954 MB). htop shows 3157 MB used of 3954 MB.

However, the value sysinfo gives for free ram (136 MB) is obviously wrong (if free ram is ram that hasn’t been allocated or something, I don’t know).

This question is the same problem, but the solution, involving mem_unit, doesn’t work because mem_unit = 1 on my system.

Here’s a minimal program that gives the same values:

#include <stdio.h>
#include <sys/sysinfo.h>


int main() {
    /* Conversion constants. */
    const long minute = 60;
    const long hour = minute * 60;
    const long day = hour * 24;
    const double megabyte = 1024 * 1024;
    /* Obtain system statistics. */
    struct sysinfo si;
    sysinfo (&si);
    /* Summarize interesting values. */
    printf ("system uptime : %ld days, %ld:%02ld:%02ld\n", 
            si.uptime / day, (si.uptime % day) / hour, 
            (si.uptime % hour) / minute, si.uptime % minute);
    printf ("total RAM   : %5.1f MB\n", si.totalram / megabyte);
    printf ("free RAM   : %5.1f MB\n", si.freeram / megabyte);
    printf ("mem_unit:   : %u\n", si.mem_unit);
    printf ("process count : %d\n", si.procs);
    return 0;
}

Output:

system uptime : 0 days, 10:25:18
total RAM   : 3953.9 MB
free RAM   : 162.1 MB
mem_unit:   : 1
process count : 531

What’s going on here? Is freeram not what I think it is?

  • 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-06-17T07:48:25+00:00Added an answer on June 17, 2026 at 7:48 am

    Linux doesn’t like when free memory is used nowhere. So when there is free memory available, it takes it temporarily as cache memory and buffers. The free memory seems very low, but as soon as a program requires memory, Linux reduces its cache / buffers usage and give the program what it wants.

    The Linux command free -m displays the state of the memory, cache and buffers.

    See this link for example and detailed information.

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

Sidebar

Related Questions

Full source for this issue can be found here: https://github.com/Cheesebaron/MvvmCross.SettingsSample My main concern lies
My full code can be seen at https://github.com/andyw8/simpleform_examples I have a join model ProductCategory
Note: Full code can be found at http://github.com/basicxman/andrewhorsman.net I have a Tag model and
Full implementation is here https://gist.github.com/1306491 I'm using struct with implicit casting to implicitly convert
full code https://github.com/gertcuykens/haskell-design How can i lift Maybe from Maybe Text type application ::
Full code at https://gist.github.com/992562 . I am using HTML File API and drag/drop to
Full gist at https://gist.github.com/3442562 I have an analyzer: analyzer : { lowercase_keyword : {
FULL CLASS CODE HERE: http://pastebin.com/rdjDGLJS EDIT: Latest code snippet taken from original posters comment
Full script here: http://pastebin.com/d6isrghF I'll admit I'm very new to Python so please forgive
Full code. public function indexAction(){ echo '<a href=https://www.facebook.com/dialog/oauth?client_id=475302972487577&redirect_uri=http://bp.mysite.com/en/social/fblogin target=_blank>Login met facebook</a> '; } const

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.