[Solved] Insanely large C++ binary. Bad linking to blame ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Neolander
Member
Member
Posts: 228
Joined: Tue Mar 23, 2010 3:01 pm
Location: Uppsala, Sweden
Contact:

Re: Insanely large C++ binary. Bad linking to blame ?

Post by Neolander »

Selenic wrote:@Neolander: You *can* mix together different page sizes, you know.
No, I didn't know, you're learning me something new here ;) When reading Modern Operating Systems (my main reference book), I basically assumed that there could only be one kind of page, with the OS having the right to change its size based on hardware capabilities and that's all.
I did not take the time to fully read all details in AMD manuals at the moment. I can't read big books (> 20 pages) on a computer screen, I need a hard copy for that, otherwise all I can do is open the PDF, search something, reads some pages around it, and close the pdf.

Sadly, I couldn't find out how to get a hard copy of AMD manuals on their site. And Intel stopped editing hard copies of their manuals, so it's not an option anymore.
Also, in some cases, you have large data structures that are never paged (ie, they're generated in memory), in which case you get the advantages of larger pages without the main disadvantage.
How do I access those if they aren't paged and I have paging enabled ? Is there a way other than identity mapping, except keeping enabling/disabling paging ?
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

Re: Insanely large C++ binary. Bad linking to blame ?

Post by Selenic »

Neolander wrote:
Selenic wrote:@Neolander: You *can* mix together different page sizes, you know.
No, I didn't know, you're learning me something new here ;) When reading Modern Operating Systems (my main reference book), I basically assumed that there could only be one kind of page, with the OS having the right to change its size based on hardware capabilities and that's all.
Basically, in the page directory there's a bit which indicates whether what it points at is a page table with 512*4K entries or a 2M page. Similar at the next level up if you're using 1G pages. The wiki page on Paging tells you how to do this in 32-bit non-PAE mode; the same bit (bit 7) is used in other paging modes for the same purpose.
Neolander wrote:
Also, in some cases, you have large data structures that are never paged (ie, they're generated in memory), in which case you get the advantages of larger pages without the main disadvantage.
How do I access those if they aren't paged and I have paging enabled ? Is there a way other than identity mapping, except keeping enabling/disabling paging ?
Sorry, that's me not being clear. I meant it's never paged out to disk. It would still be mapped into memory in the usual way.
Post Reply