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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:40:28+00:00 2026-06-15T17:40:28+00:00

My application, which turns given data into a tree representation, is using way too

  • 0

My application, which turns given data into a tree representation, is using way too much memory. As it manages to turn around 200-300MB of memory into roughly 3GB before crashing.

I now want to figure out where the leak is, which part of the program causes that.

Therefore I do now wonder what the most common and efficient technique for memory-profiling in common-lisp, using sbcl is?

I already looked at (room) and (time) but its output is way to verbose, all I need is a wrapper which will say “After the execution the overall memory usage was +1000Byte”, this would do the deal as I just want to know where the memory is used. Another criteria is that it has to work “on the fly” as the application will most likely crash, due to no remaining RAM.

Something looking like this:

(dotimes (i 4)
  (profiler-wrapper :messg "After execution memory ~a~%"  (execute-me i) ))

After execution memory +100Mb
After execution memory +100Mb
After execution memory +100Mb
After execution memory +100Mb
NIL
  • 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-15T17:40:29+00:00Added an answer on June 15, 2026 at 5:40 pm

    I wrote my own version of such an macro, it is most likely not elegant and it does slow the code significantly due to (sb-ext:gc :full t) but it does give some perspective of the memory usage after the execution of a given body.

    (defparameter *last-profile-step* 0)
    
    (defmacro profile-it ((name gc-on) &body body)
        `(let ((*last-profile-step* ,(if gc-on
                         `(progn
                        (sb-ext:gc :full t)
                        (sb-kernel::dynamic-usage))
                         `(sb-kernel::dynamic-usage))))
           (unwind-protect 
            (progn
              ,@body)
         (progn
           (FORMAT t "After execution of ~a : ~a byte~%" ,name
               (- ,(if gc-on
                   `(progn
                      (sb-ext:gc :full t)
                      (sb-kernel::dynamic-usage))
                   `(sb-kernel::dynamic-usage))
                  *last-profile-step* ))))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which logs in into a webservice. I start a new
Given a Cocoa application which runs on Mac OS X 10.7 and later: What
I'm writing a VB.Net WinForms application that has multiple data girds on any given
I've been looking into a legacy application with a web-based user interface. Given its
I'm developing a Grails (Version 1.3.3) Web-Application using the Grails Spring-Security Plugin, Spring-Security-Core-1.0.1 (which,
i have a multi-threaded application which wants to send a sequence of data to
My application (which is a windows service) needs one command line argument which is
The application which runs smoothly on 4.0.1 when was tried on run on 4.2.1
I have an application which uses the microsoft kinect device. The thing is that
I have a WPF application which connects to a remote database over internet and

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.