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 7880447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:08:49+00:00 2026-06-03T04:08:49+00:00

we would need to know how much memory and cpu time a matlab process

  • 0

we would need to know how much memory and cpu time a matlab process had used with all of it’s spawned threads. If I understand it correctly, all the threads will pop up as new processes with new process-ids but the CMD name will remain the same.

so I thought about creating a demon which append the usage in every n sec:

ps -o %cpu,%mem,cmd -C MATLAB | grep "[0-9]+" >> matlab_log

and later counting and summing up the ratios multiplied by the demon tick time.

I wonder if there is an easier way, or I missing something, or simply just exist some tool more handy for this job?

Cheers

  • 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-03T04:08:50+00:00Added an answer on June 3, 2026 at 4:08 am

    If you install the BSD Process Accounting utilities (package acct on Debian and Ubuntu) you can use the sa(8) utility to summarize executions or give you semi-detailed execution logs:

    $ lastcomm
    ...
    man               F  X sarnold  pts/3      0.00 secs Fri May  4 16:21
    man               F  X sarnold  pts/3      0.00 secs Fri May  4 16:21
    vim                    sarnold  pts/3      0.05 secs Fri May  4 16:20
    sa                     sarnold  pts/3      0.00 secs Fri May  4 16:20
    sa                     sarnold  pts/3      0.00 secs Fri May  4 16:20
    bzr                    sarnold  pts/3      0.99 secs Fri May  4 16:19
    apt-get          S     root     pts/1      0.44 secs Fri May  4 16:18
    dpkg                   root     pts/1      0.00 secs Fri May  4 16:19
    dpkg                   root     pts/1      0.00 secs Fri May  4 16:19
    dpkg                   root     pts/1      0.00 secs Fri May  4 16:19
    apt-get           F    root     pts/1      0.00 secs Fri May  4 16:19
    ...
    
    $ sa
         633      15.22re       0.09cp         0avio      6576k
          24       8.51re       0.03cp         0avio      6531k   ***other*
           2       0.31re       0.02cp         0avio     10347k   apt-get
           3       0.02re       0.02cp         0avio      9667k   python2.7
          18       0.04re       0.01cp         0avio      5444k   dpkg
           2       0.01re       0.01cp         0avio     13659k   debsums
    ...
    

    The format of the acct file is documented in acct(5), so you could write your own programs to parse the files if none of the standard tools lets you express the queries you want.

    Probably the largest downside to the BSD process accounting utilities is that the kernel will only update the process accounting log when processes exit, because many of the summary numbers are only available once another process wait(2)s for it — so currently running processes are completely overlooked by the utilities.

    These utilities may be sufficient though; these utilities is how compute centers billed their clients, back when compute centers were popular…

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

Sidebar

Related Questions

Does anyone know the display formatter that I would need to add to the
Greetings, Would like to know if we need to explicitly free the string allocated
I would need to get a Regular Expression, which matches all Unicode control characters
I would need some help in python. I'm new in python. I used to
So I need to understand how swing allocates memory for buffering screen rendering. Obviously
I'm really new to java, and I need to know is this a memory
I would need to build a html table that has a horizontally scrollable column.
I would need a readonly / unmodifiable java.util.Stack . For List s there is
I have a project in which I would need to copy files found within
Im a javascript newbie and would need some help with this simple thing... I

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.