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

  • Home
  • SEARCH
  • 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 6615879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:30:58+00:00 2026-05-25T20:30:58+00:00

I basically have an object, which I call two functions from, and three functions.

  • 0

I basically have an object, which I call two functions from, and three functions.

function func1()
    M.mfunc1( 'updateSomething' );
    // do some stuff
    M.mfunc2();
}

function func2 () {
  M.mfunc1 ( 'hitSomething' );
  // does something but line is stable
  M.mfunc2();
}

function func3 () {
  M.mfunc1 ( 'doesSoemthing' );
  //does nothing, but causes memory to grow
  M.mfunc2();
}

M.mfunc1 = function ( name ) {
  // code is all commented out
}

M.mfunc2 = function () {
  // code is all commented out
}

func1n is called on a main loop using setTimeout. When using Chromes’s Dev Tools on the Timeline watching Memory, memory suddenly grows on the call of func3, but if I comment out the M calls, it stays stable. I resorted to commenting everything out of M.mfunc1 and M.mfunc2 and by just calling it a lone, it causes memory usage to grow.

Now can someone explain that to me?

Update: I made my code more like what it really is.

Update 2: Since the example code I gave doesn’t seem to be the problem, here’s a link to all the code: http://test.startailpro.co.uk/breaking/

The functions are update, updateDirection, hitBlock, doesBall_hitBlock, MEMORY.deep and MEMORY.rise.

  • 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-25T20:30:59+00:00Added an answer on May 25, 2026 at 8:30 pm

    In the end what I did was rewrite the whole code. I actually managed to write the whole thing without using objects, except on load. I still don’t know what’s wrong from the original code, but I am now better able to understand memory is used an grows.

    Memory being allocated

    I would recommend being careful what framework you choose. I found in jQuery that events causes memory growth. Since your receiving an object and an object is being generated for the event this not be a issue. Although, I am under the assumption that event objects are native and have been optimised so memory growth is not an issue. Again, be careful of frameworks.

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

Sidebar

Related Questions

I have a helper function, which basically calls CompareTo on two objects, but does
Basically I have some class objects, each with three properties. Once one class object
I have a spring-hibernate application which is failing to map an object properly: basically
Basically I have a datagridview which I retrieve from database and 3 of the
I have a simple function I want to call in two separate program executions.
A bit hard to find a proper title... I have an object which basically
I have an object that is basically a Python implementation of an Oracle sequence.
I have a Javascript object that basically represents a Row in an .NET GridView.
I have a scraping object basically. I want to be able to add POST
I have a DLPUser object in my session, this DLPUser is basically a container

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.