Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
76 user(s) are online (63 user(s) are browsing Forums)

Members: 1
Guests: 75

PEB, more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: Extended Memory (and just a memory) questions

Subject: Re: Extended Memory (and just a memory) questions
by broadblues on 2019/8/18 15:59:57

@kas1e

Quote:

I write some simple test case and found, that i can only allocate just about ~1.4gb on one malloc, while i have 250 mb free. So in summ its just 1.650 in whole , but its already barier to burn and crash. So its of course not 2gb (as 31 bit addressing), but even not 1.8gb, but ~1.7gb of memory which can be used under aos4 :)


Yes, this is subtlity sometimes missed. You have a limit of 2Gb of (signed) address space, system ram is not the only thing usuing that space, the first 256 of gfx card memeory, PCI card memeory etc also eat inot that so that is why a X1K sometimes appears to run out of memory evn when it has 500Mb "free" .

Quote:

So, question, can i use that Extended Memory thing, to just add relevant code in those helpers myalloc() and myfree() functions, so, they will just works as it, but just will have ability to alloc and 1.5gb via malloc, and 2gb and whatever extendent memory can handle.


No. To use Extended Memory in a useful way you need some kind of paging system.

For example sketchblock has buffer objects composed of a number of pages of Extended (or normal) memory. When these buffer are reference via their 'get or set methods' then the relavant pages are paged in and out using the extended memeory API functions. I have a LRU cache of paged in pages to optimise this process and limit the amount of memory space used at any one time whilst slaos reducing cache misses.

If your application needs to directly access very large blocks of memory in that way without any kind of access API (ie by simply dereferencing pointers,) you are not going to be able to use ExtMem for it.


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project