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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:11:07+00:00 2026-06-05T05:11:07+00:00

If I have object A , which calls DAO object B to perform some

  • 0

If I have object A, which calls DAO object B to perform some database update – Once B's function completes it calls a call back function in A (A.finishProcess()) does this create memory issues? I mean does B then remain in memory until A completes? or is B still removed with GC?

I ask this as I’m considering using call backs instead of returning a “result” object or code from B.

In short, is it better design (and memory usage) wise to “return” an object of results rather than using a callback to a calling object?

PS: Please ignore specific’s ie, it doesn’t mention AsycnTask, its a contrived situation to get my question across 🙂

Cheers for any help

  • 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-05T05:11:08+00:00Added an answer on June 5, 2026 at 5:11 am

    It is all about references. As long as you don’t store/keep any (strong) references around (i.e. proper deregistration, clearing references once the object is no longer in use, etc), you don’t have to worry as the object will properly be handled by GC.

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

Sidebar

Related Questions

I have a service method that calls a DAO which then returns an object
I have class World which manages creation of object... After creation it calls afterCreation
I have a helper function, which basically calls CompareTo on two objects, but does
I have a datagridview which we will call dataGridViewExample. My object (the uncommon datatypes
I have a method under test. Within its call stack, it calls a DAO
I have an application which makes calls to an online database. If I lose
I have a web application which calls WCF service to get an object. I
I have an activity object, myAct. myAct creates and calls my httpGetter object which
I now have the following code, which calls a WCF service, it get some
I have an object ajax_tryit which calls ajax_generic ans sends it 3 functions. They

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.