Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Memory management

by abubacker (Pilgrim)
on Aug 12, 2009 at 05:37 UTC ( #787836=perlquestion: print w/replies, xml ) Need Help??
abubacker has asked for the wisdom of the Perl Monks concerning the following question:

Dear community ,
I want to write a program in which memory management is a major part.
whether perl supports memory management.
If yes show me a glance of it.

Thanks in Advance !

Replies are listed 'Best First'.
Re: Memory management
by CountZero (Bishop) on Aug 12, 2009 at 05:53 UTC
    I thought Perl was a language where you didn't have to bother yourself with such low-level matters as "memory management".


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      Yes you are correct ,
      but when I am going to develop a new and small OS based on the linux kernel I have to take care all the low level parameters ,
      so please help me out !

        Then Perl is too high level to deal with such details.

        I'd recommend you read a good book on operating system design, I've heard that "Modern Operating Systems" by Tannenbaum should be quite good (though never read it myself).

        The Perl memory management model is both simple and high performance.

        If you watch the memory "footprint" of a long lived Perl process, you will observe that it grows and never gets smaller. Once Perl has a hunk of memory from the OS, it will never give it back to the OS although Perl will reuse that memory for its own purposes. So a Perl process approaches a maximum size as it runs.

        It is possible nowadays to run Perl even on a small embedded system. JAVA or C# have much more complex memory models as well as complex, hard to understand performance "hits".

        Perl may or may not be a good implementation language for your system. More and more systems are built with a mixture of languages. Perl is THE "black belt" at processing text. Last year I talked with some folks who write automated commodity trading software. These guys are like 300 feet via fiber optic cable from the exchange - it doesn't get closer than that. What do these guys use to handle the text data? You got it, Perl! What do they use to drive the "middle ware"? You got it, 'C'.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://787836]
Approved by ww
[Corion]: Hi choroba! Yay, day off sounds great! I hope the performances of the kids go well!
[Corion]: I think I'm overdesigning things again. I want to export(later, synchronize) data from Google Keep, by scraping the HTML. And I'm thinking of automating this by having a canary note whose text my program knows and from which it can determine the ...
[Corion]: ... surrounding HTML to scrape all the other notes. Maybe I should better look at dumping all the requests that pass between Google and my "browser" instead.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-12-12 08:49 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (327 votes). Check out past polls.