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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:14:59+00:00 2026-06-14T20:14:59+00:00

I am using multiple inheritance with boost serialization. instead of doing boost::serialization::base_object< Connection<T> >(*this)

  • 0

I am using multiple inheritance with boost serialization. instead of doing

boost::serialization::base_object< Connection<T> >(*this)
boost::serialization::base_object< Collection<C> >(*this)

I am doing

template<typename ArchiveT>
void save(ArchiveT& arc, const unsigned version) const{
  //both Connection<T> and Collection<C> are Base Classes
  Connection<T>::save(arc, version);
  Collection<C>::save(arc, version);
}

and its working. So is two of them the same thing ? or there is any harm in doing this ? should I change this code ?

{This thing was coded long ago. So I forgot Why I coded it in that way. may be I was not aware of base_object at that time}

I am serializing huge set of data (~1.6 GB) .When I serialize I see serialization process is taking a lot of memory and hitting 3GB barrier. I’ve tried commenting serialization code and it takes < 50MB memory . So what makes serialization taking that big memory ?

  • 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-14T20:15:00+00:00Added an answer on June 14, 2026 at 8:15 pm

    You should change your code and serialize the base classes through base_object<>().

    From the documentation:

    […] Note that this is NOT the same as calling the serialize function of the base class. This might seem to work but will circumvent certain code used for tracking of objects, and registering base-derived relationships and other bookkeeping that is required for the serialization system to function as designed. For this reason, all serialize member functions should be private.

    The extra memory consumption is probably caused by object tracking.
    If you have a large quantity of objects being tracked, the memory consumption can increase drastically during serialization.

    From special considerations:

    If it is known a priori that no pointer values are duplicated, overhead associated with object tracking can be eliminated by setting the object tracking class serialization trait appropriately.

    If you don’t require object tracking, you may disable it with:

    BOOST_CLASS_TRACKING(the_class, boost::serialization::track_never)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple inheritance like this one: Can I extend a class using more
I'm setting up a data model in django using multiple-table inheritance (MTI) like this:
Ok, I'm using virtual functions, overloaded functions, and multiple inheritance. Of course this doesn't
This is my first major application using multiple classes. It is written in vb
This question is inspired in the following solution to multiple inheritance overloading pseudo-ambiguity, which
When using multiple inheritance C++ has to maintain several vtables which leads to having
I've been using multiple inheritance in c++ for quite a long time, but only
Should I be using multiple base pages with inheritance or is there a better
I understand the need for virtual inheritance when using multiple inheritance -- it solves
Here's an example using multiple interface inheritance in Java and there's an issue. Note

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.