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

memory: user-space #13

Open
wants to merge 8 commits into
base: Matvii.Zorin
Choose a base branch
from

Conversation

matthewzorin
Copy link

Merge solution for the first part of the Memory management task

yekovalyov and others added 7 commits February 6, 2020 22:21
Signed-off-by: Yevgen Kovalyov <[email protected]>
Signed-off-by: Yevgen Kovalyov <[email protected]>
	Measure time of functions malloc and free
	Get average of execution time

Signed-off-by: Zorin Matvii <[email protected]>
	See "Segmentation fault" in alloc_test() function

Signed-off-by: Zorin Matvii <[email protected]>
	Get standart stack size information via pthread attribute
	Count free allocation space using the appropriate coefficient (wontfix)
	Fix output of buffer size power (change the increment moment)

Signed-off-by: Zorin Matvii <[email protected]>
memory/log.txt Outdated
23 8388608 2389343 839
24 16777216 5158120 1421
25 33554432 26193 17083
26 67108864 10045 9273
Copy link
Contributor

@yekovalyov yekovalyov Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can You explain why allocation of 2^25 bytes faster than allocation of 2^24 bytes?

Copy link
Author

@matthewzorin matthewzorin Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe in linux calloc function uses simple allocation and memset in cases, where we need lesser than the certain amount of bytes. So, in another cases it switches to the more efficient way for getting zero-initialized memory. For example - zeroed pages (2^24 bytes - 4096 pages, 1 page - 4096 bytes), but this method needs more time than I measured. I'd glad to receive Your opinion about this result

@yekovalyov yekovalyov added question Further information is requested and removed ready for review labels Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants