in Education by
My problem is: I have a perl script which uses lot of memory (expected behaviour because of caching). But, I noticed that the more I do caching, slower it gets and the process spends most of the time in sleep mode. I thought pre-allocating memory to the process might speed up the performance. Does someone have any ideas here? Update: I think I am not being very clear here. I will put question in clearer way: I am not looking for the ways of pre-allocating inside the perl script. I dont think that would help me much here. What I am interested in is a way to tell OS to allocate X amount of memory for my perl script so that it does not have to compete with other processes coming in later. Assume that I cant get away with the memory usage. Although, I am exploring ways of reducing that too but dont expect much improvement there. FYI, I am working on a solaris 10 machine. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
What I gathered from your posting and comments is this: Your program gets slow when memory use rises Your pogram increasingly spends time sleeping, not computing. Most likely eplanation: Sleeping means waiting for a resource to become available. In this case the resource most likely is memory. Use the vmstat 1 command to verify. Have a look at the sr column. If it goes beyond ~150 consistently the system is desperate to free pages to satisfy demand. This is accompanied by high activity in the pi, po and fr columns. If this is in fact the case, your best choices are: Upgrade system memory to meet demand Reduce memory usage to a level appropiate for the system at hand. Preallocating memory will not help. In either case memory demand will exceed the available main memory at some point. The kernel will then have to decide which pages need to be in memory now and which pages may be cleared and reused for the more urgently needed pages. If all regularily needed pages (the working set) exceeds the size of main memory, the system is constantly moving pages from and to secondary storage (swap). The system is then said to be thrashing and spends not much time doing useful work. There is nothing you can do about this execept adding memory or using less of it.

Related questions

0 votes
    Background: I need to reserve an amount of memory below 0xA0000 prior to my operating system starts. To do ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Background: I need to reserve an amount of memory below 0xA0000 prior to my operating system starts. To do ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    an operatingsystem______ memory to____ files and folders a) allocates,store b) locates,manage. c)allocates,program. d)stores,allocate Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Which of these operators is used to allocate memory to array variable in Java? (a) malloc (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Which of these operators is used to allocate memory for an object? (a) malloc (b) alloc (c) new ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    io 3. When you switch on the computer, the Windows OS gets loaded onto the computer's memory, this process is ... (d) None of these Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    How to dynamically allocate a 1D and 2D array in c?...
asked Jan 24, 2021 in Technology by JackTerrance
0 votes
    You want to open a new word document having a pre-defined page layout, fonts, margins, and styles. What should ... again and again? I Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    What is the right amount of data to allocate for training, validation, and test sets?...
asked Mar 11, 2021 in Technology by JackTerrance
0 votes
    How to get prints of shared object memory maps or heap memory maps for a given process? (a) jmap ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    I am trying to use change tracking to copy data incrementally from a SQL Server to an Azure SQL Database. I ... change tracking table? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    What would you do when JVM is consuming 100% CPU & Memory on a server?...
asked Jun 11, 2021 in Technology by JackTerrance
0 votes
    _____ is the concept in which a process is copied into the main memory from the secondary memory according to the ... a) Paging b) Demand paging c) Segmentation d) Swapping...
asked Oct 27, 2022 in Education by JackTerrance
0 votes
    2. Which memory is responsible for booting process? RAM ROM O O Hard disk O Flash Drive Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    For which reforms were the women’s movement in the pre-independence period fighting? Please answer the above question....
asked Aug 14, 2022 in Education by JackTerrance
...