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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:08:34+00:00 2026-05-27T21:08:34+00:00

I have to write a program (perl , python or java) to simulate workload

  • 0

I have to write a program (perl , python or java) to simulate workload on our server such that it takes 2 arguments :

  1. Memory

  2. Time

And based on these arguments it should start a process that consumes the specified amount of memory for specified amount of time.Max value of memory can be as high as 50-100GB and Time can be upto 12-24 hrs.

I cannot use fork or multi threads, this process should be a single thread and should continuously do operations (like Integer / Floating point etc). I don’t want to do any I/O operations also.

The simplest way I could think of was:

 1. while(timeSpent < timeLimit || memoryConsumed < memorySpecified){
 2.           if(memoryConsumed < ){
 3.                Add random number to ArrayList 
 4.           }else{
 5.                Multiply all numbers (Do some exception handling to prevent this from overflowing) 
 6.           }
 7. }

Please let me know if there is a better way of doing this.

Thanks,

Amit

  • 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-27T21:08:35+00:00Added an answer on May 27, 2026 at 9:08 pm

    I am using the utility stress weather.ou.edu/~apw/projects/stress … though tweaked it a bit to extend the features that I wanted..

    Thanks for your help guys.

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

Sidebar

Related Questions

I have a Perl program, that needs to use packages (that I also write).
I have been assigned wit the task to write a program that takes a
I have to write a program that read from a file that contains the
I have to write a program that sniffs network packets (part1-the simple part). And
I have been asked to write a program using python for an assignment. I
I wanted to write a program that test if two files are duplicates (have
I have been asked to write a java program on linux platform. According to
How to write a java program which will tell me whether I have internet
I have to write a program that accepts a sequence of average daily temperatures
We have a Perl program to validate XML which is invoked from a Java

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.