Newlisp Memory Usage

Pondering the philosophy behind the language
Locked
Sunburned Surveyor
Posts: 28
Joined: Thu Jan 13, 2005 12:42 am
Location: California
Contact:

Newlisp Memory Usage

Post by Sunburned Surveyor »

I've got 3 brief questions about newLISP memory usage. I looked over the manual, but didn't see anything that answered my question directly.

[1] Is there a way to see the total amount of memory newLisp is using at a given moment?

[2] Is there a function that returns a list of all the symbols currently in memory? How about the size of each symbol in memory?

[3] Is there a way to time the execution of a newLISP function?

Thanks,

The Sunburned Surveyor

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

(1) 'sys-info' reports the number of lisp cells used, 16 bytes per cell. There is also a command line switch to limit cell memory usage.

(2) 'symbols' returns a list of symbols used, 32 bytes per symbol.

(3) 'time' can be used to time a function

I suggest reading the users manual (first part of newlisp_manual.html) completely (about 50 pages) and at least scan over the list of functions available and read their one-line descriptions.

Another doument to read for the beginner in newLISP is the http://newlisp.org/DesignPatterns.html document also linked in the http://newlisp.org/index.cgi?page=Tips_and_Tricks section. It shows how typically things are done in newLISP in various areas of application development.

Also remember that the latest revision of the manual is always the one online at http://newlisp.org/downloads/newlisp_manual.html or http://newlisp.org/downloads/manual_frame.html with an index frame, at the moment we are at revision 7.

Lutz

Sunburned Surveyor
Posts: 28
Joined: Thu Jan 13, 2005 12:42 am
Location: California
Contact:

newLISP Manaual

Post by Sunburned Surveyor »

Lutz,

Thank you for the information. I do have a printed copy of the newLisp manual. It is highlighted and has notes scribbled in the margins. :]

However, I seem to have a difficult time making sense of some of the things in the manual. It is a great reference, but I wish there was some more newLISP documentation for beginners.

I did also download the Design Patterns in newLISP doc. I haven't read through it thoroughly yet, but will.

I hope my questions are not a bother. I am trying to implement an object-oriented framework for newLISP, which I will use to implemement my geometry library.

This is a lot of work though, and the source of my many questions! I will release all my code back to the community when I have my first stable build.

More importantly, I will prepare thorough documentation that will guide a new lisper through the process of using newLISP, and will help them to understand how to use newLISP printing for object oriented programming. The documentation will take them through the construction of my geometry library step by step, so that they understand the concepts.

I haven't forgotten about my IDE for newLISP either. I'm still learning about how to write a parser in Java. When I've got a handle on this, I will start the newLISP plug-in for Eclipse, which will support my newLISP OOP system.

My newLISP OOP system will offer these features to the newLISP community:

Object-Oriented Programming Abilities
Overloaded Methods
Object Inheritence and Polymorphism
Error Handling
Event Handling
newLSIP OOP Wrapper for GTK/GTK-Server GUI Components

In the future I also hope to implement a Unit Testing feature similar to JUnit.

Thanks again for your help.

Landon

P.S. - Is it possible for a symbol to contain more than 32 bytes? For example what if I use symbol A to store a list that contains symbol B and symbol C, which are both 32 bytes? Are symbol B and symbol C stored by reference only?

Ryon
Posts: 248
Joined: Thu Sep 26, 2002 12:57 am

Post by Ryon »

You could also ctl-alt-del >Processes for the system's view of your memory useage.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

>> Is it possible for a symbol to contain more than 32 bytes?

Yes, of course, what I meant with 32 bytes was the internal representation of a symbol in newLISP. You can store in it whatever you want, and whatever size you wish.

Lutz

Locked