Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RealAllocator::allocate() is inefficient because it scans each bit of the heap. #4

Open
aarontabor opened this issue Aug 11, 2015 · 8 comments
Assignees

Comments

@aarontabor
Copy link
Contributor

To find a free contiguous chunk of heap, the RealAllocator currently traverses the heap. This is less than optimal for several reasons:

  • we know that objects have a minimum size
  • we know something about alignment

By scanning the heap bit by bit, we are performing an unnecessary amount of work.

@aarontabor
Copy link
Contributor Author

A decision has been made to use card tables to increase the efficiency of heap allocation.

@tmbasa tmbasa self-assigned this Aug 11, 2015
@tmbasa
Copy link
Contributor

tmbasa commented Aug 11, 2015

I fixed this in commit e9608dc

@tmbasa tmbasa closed this as completed Aug 11, 2015
@aarontabor aarontabor reopened this Aug 13, 2015
@aarontabor
Copy link
Contributor Author

I think this fix introduces a new error, when I run a simulation with the default collector, I'm getting seg-faults. Running the same simulation using the state of the project before this commit works as expected.

@konsna
Copy link
Member

konsna commented Aug 13, 2015

Please test thoroughly before updating the master branch. Work in progress can be pushed to a development branch.

@aarontabor
Copy link
Contributor Author

It turns out that the fix e9608dc was depending on an updated version of tracefiles that have not yet been released to the entire team. When I used the previous version of the tracefiles, I was getting segmentation faults.

Since it is the previous version of tracefiles which are currently available to the team, I have reverted the changes introduced by this fix on the master branch. I have created a new branch: dev-travefileSizeInvariantFix where this fix, and other modifications required for the new version of tracefiles can be made. Once the new version of tracefiles become publicly available to the team, dev-tracefileSizeInvariantFix can be merged back into master.

@tmbasa
Copy link
Contributor

tmbasa commented Aug 14, 2015

The updated tracefiles are actually available on Mazder's team folder. The updated tracefiles have the number of pointers (N) adjusted to fit the object size. But these are the post-processed ones.

@tmbasa
Copy link
Contributor

tmbasa commented Aug 19, 2015

Modified using card table class instead of direct checking (of bitmap).

32ab5b4

@tmbasa
Copy link
Contributor

tmbasa commented Aug 19, 2015

Also in update: 32ab5b4,

added -pg on all subdir.mk and the makefile to allow profiling (gprof)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants