Jump to content

MEMORY ISSUE... Not solved but a hope at the end of the tunnel !


Guest rodrigofd

Recommended Posts

Guest rodrigofd

Okay guys, most of you , if you are hanging around here for a while , you probably are aware of the various 'memory issues' that our I8000 suffer from.. among others, memory leaks, auto closing apps, etc.

But probably the most crucial one is the 'half-memory' reservation, done by Samsung, where it locks and reserves 50% of physical memory (RAM) which is left unavailable for general WM usage. So far, we didn't achieve anything regarding this subject.

What i CAN tell you, is that it is not in the EBOOT, it is hard-coded in the main device kernel (nk.exe) inside kernel partition.

Now for the 'hope' part: one of greatest WinMobile and XDA gurus of all time, CMONEX, has answered my prayers in this matter. She said that reservation is probably reserved and USED by drivers or radio part, and such usage might be reduced if some of it is wasted allocation.

She can do such work, but she's unavilable following weeks, maybe a couple months later she replied, might be able to help us :) ...

Link to comment
Share on other sites

We gonna need that damn half RAM right before WinMobile7 release, late next year! Then we will be able to flash our toys to WinMo7 exactly when HD2 is going to get it first due to its pre-qualification!

Thanks for the news :)

Link to comment
Share on other sites

Guest FerdiBorbon

rodrigofd thank you for the kind update, at least this will put peoples mind at ease trying to figure out where the reserved ram was coming from.

Just enjoy your Christmas and New Years people :)

Link to comment
Share on other sites

Okay guys, most of you , if you are hanging around here for a while , you probably are aware of the various 'memory issues' that our I8000 suffer from.. among others, memory leaks, auto closing apps, etc.

But probably the most crucial one is the 'half-memory' reservation, done by Samsung, where it locks and reserves 50% of physical memory (RAM) which is left unavailable for general WM usage. So far, we didn't achieve anything regarding this subject.

What i CAN tell you, is that it is not in the EBOOT, it is hard-coded in the main device kernel (nk.exe) inside kernel partition.

Now for the 'hope' part: one of greatest WinMobile and XDA gurus of all time, CMONEX, has answered my prayers in this matter. She said that reservation is probably reserved and USED by drivers or radio part, and such usage might be reduced if some of it is wasted allocation.

She can do such work, but she's unavilable following weeks, maybe a couple months later she replied, might be able to help us :) ...

As I know that when we port WM6.5.3 we use the latest nk.exe from other devices. It means that all XIP ROM has the MS nk.exe but not Samsung version.

But the same issue in WM6.5.3. I'm not sure where the reserved memery hided now but it not like from nk.exe

Whatever, it's good news for all I8000 user.

Thank you for your information!

Edited by gcrasy
Link to comment
Share on other sites

As I know that when we port WM6.5.3 we use the latest nk.exe from other devices. It means that all XIP ROM has the MS nk.exe but not Samsung version.

But the same issue in WM6.5.3. I'm not sure where the reserved memery hided now but it not like from nk.exe

I totally agree.

Link to comment
Share on other sites

Guest rodrigofd
I totally agree.

Sorry, but your info is totally incorrect!!! NK.EXE is precisely the most 'device-dependent' pieces of WM !! When you port the WM version, you keep the original NK.EXE, which is written exclusively by Samsung.

WM version porting has NOTHING to do with the kernel issue, and nk.exe among other things, is responsible for low-level memory handling, specially if reserved memory should be allocated for drivers, etc.

Link to comment
Share on other sites

Guest Michael Pang
Sorry, but your info is totally incorrect!!! NK.EXE is precisely the most 'device-dependent' pieces of WM !! When you port the WM version, you keep the original NK.EXE, which is written exclusively by Samsung.

WM version porting has NOTHING to do with the kernel issue, and nk.exe among other things, is responsible for low-level memory handling, specially if reserved memory should be allocated for drivers, etc.

i have a question, even we find that nk.exe is controlling the amount of reserved memory, there is still another issue, which is memory leak (may be samsung apps or drivers issue). To be honest, after 3 days of use using L5 rom, i only have less than 30M free memory which is even less than my old i900 and i8000 on wm6.1.

Edited by Michael Pang
Link to comment
Share on other sites

Guest touchflo

actually the problem is in eboot

and i dont have a memory leak. i disabled the windows lock screen(and samsung) because everytime id lock it, it would eat up a few MB ram. after i disable it im steady even after 5 days i still get close to 60MB.

Link to comment
Share on other sites

Guest Michael Pang
actually the problem is in eboot

and i dont have a memory leak. i disabled the windows lock screen(and samsung) because everytime id lock it, it would eat up a few MB ram. after i disable it im steady even after 5 days i still get close to 60MB.

did you use Opera or IE Mobile in the 5 days you mentioned?

Link to comment
Share on other sites

Guest touchflo
did you use Opera or IE Mobile in the 5 days you mentioned?

neither .i use opera mini for browsing.nice and fast. i only use ie for online banking.ive used emulators,played videos,opened docs,browsed,messaged,google maps,music,etc...

Link to comment
Share on other sites

Here are some thoughts and info found in regards to free RAM (I hope that at least partially it is correct).

Definition of ROMHDR (in XIP) according to Microsoft contains the following values (I only listed a few values plus data from our rom):

physfirst - First physical address. - 80300000h

physlast - Highest physical address. - 8074105Ch

ulRAMStart - Start of RAM. - 80742000h

ulRAMFree - Start of RAM free space. - 80925000h

ulRAMEnd - End of RAM. - 88000000h

The actual physical XIP RAM address starts at physfirst address, and ends at ulRAMEnd. The XIP should end at or before physlast addres. So, size of XIP that it has to fit into, is equal to (physlast - physfirst).

After physlast comes ulRAMStart, that's where RAM required for nk.exe is located, which ends at ulRAMFree. Free memory that is available for OS is between ulRAMFree and ulRAMEnd (in our rom = 88000000h - 80925000h). That's what we are left with for program memory. Shrinking XIP and relocating nk.exe will allow to recover some of the wasted space and give some program memory (but you can't move a module out of XIP if it is required by the system).

Another test I did was to delete some modules from XIP, but this only gave me a little bit of RAM, so the only way is to go in the other direction.

So the other limiting end is ulRAMEnd (88000000h). What is beyond this value? Can this value be increased?

Edit:

I did a test. I changed End of Ram address from 88000000 to 88020000 (in Romhdr.bin in XIP and imageinfo.bin in .VM) but unfortunately it didn't work. The phone got to WM (orange) splash screen, and after one beep it didn't get to calibration screen. I think that the address may be also coded in nk.exe, or maybe there is something else that I don't know about. Another test I might try to do tomorros is to reduce End of Ram and see if the phone boots.

Edited by wes58
Link to comment
Share on other sites

neither .i use opera mini for browsing.nice and fast. i only use ie for online banking.ive used emulators,played videos,opened docs,browsed,messaged,google maps,music,etc...

did you multitask a lot? how did you manage to ged rid of the annoying auto closing apps by the phone itself?

Link to comment
Share on other sites

Found something in the registry...did some googling but did not find any info on this...any sifu got any advice?

post-60018-1261743673_thumb.png

This won't be a registy setting. It has to be hard coded in the Rom. I am pretty sure that what I wrote before is correct. The question is if we can change the address of the end of ram. And could it cause if we managed to do it?

Link to comment
Share on other sites

Here are some thoughts and info found in regards to free RAM (I hope that at least partially it is correct).

Definition of ROMHDR (in XIP) according to Microsoft contains the following values (I only listed a few values plus data from our rom):

physfirst - First physical address. - 80300000h

physlast - Highest physical address. - 8074105Ch

ulRAMStart - Start of RAM. - 80742000h

ulRAMFree - Start of RAM free space. - 80925000h

ulRAMEnd - End of RAM. - 88000000h

The actual physical XIP RAM address starts at physfirst address, and ends at ulRAMEnd. The XIP should end at or before physlast addres. So, size of XIP that it has to fit into, is equal to (physlast - physfirst).

After physlast comes ulRAMStart, that's where RAM required for nk.exe is located, which ends at ulRAMFree. Free memory that is available for OS is between ulRAMFree and ulRAMEnd (in our rom = 88000000h - 80925000h). That's what we are left with for program memory. Shrinking XIP and relocating nk.exe will allow to recover some of the wasted space and give some program memory (but you can't move a module out of XIP if it is required by the system).

So the other limiting end is ulRAMEnd (88000000h). What is beyond this value? Can this value be increased?

hmm converting that into decimals give us nothing like 140000000...

edit : nope, just realize they're memory address numbers not size count...

Edited by nap_rz
Link to comment
Share on other sites

Guest touchflo
did you multitask a lot? how did you manage to ged rid of the annoying auto closing apps by the phone itself?

i never got to really low ram for my apps to start closing. i multitask all the time. opera mini+music player or fm radio + messenger + aim + smsing + pdf or word docs .

Link to comment
Share on other sites

i never got to really low ram for my apps to start closing. i multitask all the time. opera mini+music player or fm radio + messenger + aim + smsing + pdf or word docs .

well....no offense, but I find it hard to believe you when most of us suffering about this B) :) ;) , okay for me it's not that bad now with mr. Kuanchai's ROM, not as bad as the original ROM, but sometime ago I tried opening message, opera mobile 10b2, core player, samsung photo album, contacts, and resco explorer, the RAM I approximately went down to 30, however when I opened windows' task manager 5 of them closed by the phone B) .

hm....sorry for derailing the thread, but I think and I fear even if we had 100MB of RAM this could still happen :o

Link to comment
Share on other sites

I did more testing with memory. I tried to see if changing values for ulRAMEND to a lower address will show more reserved memory (and less available RAM). And as you can see from attached picture that is a case - the yellow bar for reserved memory is bigger.

So to increase memory we would need to change ulRAMEND to higher value - as I wrote before, when I tried to do it the phone got stuck on windows splash screen.

Next thing I tried is to check if I can read memory above ulRAMEND (0x88000000). I did several reads and noticed that I can read memory up to 0x915FFFFF. Trying to read 0x91600000 locks the phone. So from this exercise I noticed that there is a memory that can be read from address 0x88000000-0x915FFFFF, which is 153,600 MB. 

Dumping the contents of this memory in different situations (having a phone on different functions like, opening a picture, media player etc.) showed that the content of this memory changes. So, I believe that Samsung reserved it for a reason - part maybe used for video memory, some programs etc.

After this, unless I am wrong, I think that chances to increase RAM by reducing reserved memory are low and we may have to live with it. And we should thank Samsung for misleading everybody (in the phone specification), to believe that we have 256 MB of RAM. Or maybe they didn't mislead us, we have 256MB of memory - they never said that it is 256MB of usable (accessible) memory, did they?

post-420700-1262038632_thumb.png

Edited by wes58
Link to comment
Share on other sites

I did more testing with memory. I tried to see if changing values for ulRAMEND to a lower address will show more reserved memory (and less available RAM). And as you can see from attached picture that is a case - the yellow bar for reserved memory is bigger.

So to increase memory we would need to change ulRAMEND to higher value - as I wrote before, when I tried to do it the phone got stuck on windows splash screen.

Next thing I tried is to check if I can read memory above ulRAMEND (0x88000000). I did several reads and noticed that I can read memory up to 0x915FFFFF. Trying to read 0x91600000 locks the phone. So from this exercise I noticed that there is a memory that can be read from address 0x88000000-0x915FFFFF, which is 153,600 MB.

Dumping the contents of this memory in different situations (having a phone on different functions like, opening a picture, media player etc.) showed that the content of this memory changes. So, I believe that Samsung reserved it for a reason - part maybe used for video memory, some programs etc.

After this, unless I am wrong, I think that chances to increase RAM by reducing reserved memory are low and we may have to live with it. And we should thank Samsung for misleading everybody (in the phone specification), to believe that we have 256 MB of RAM. Or maybe they didn't mislead us, we have 256MB of memory - they never said that it is 256MB of usable (accessible) memory, did they?

Sad but it is what I suspected before your tests hope we are wrong and there is a way to free more available ram...Very good explanation as usual :)

Edited by kibiwi
Link to comment
Share on other sites

Guest ock1991

But if the 153,600KB worth of memory is indeed used in some 'good' way ("shared graphics" in PC sense perhaps?), the fact that half of the promised 256MB RAM is inaccessible might not be so bad afterall :/

Has anyone tried forcing an answer out of the customer service center technicians about why the RAM falls short? D:

Link to comment
Share on other sites

Guest rodrigofd
But if the 153,600KB worth of memory is indeed used in some 'good' way ("shared graphics" in PC sense perhaps?), the fact that half of the promised 256MB RAM is inaccessible might not be so bad afterall :/

Has anyone tried forcing an answer out of the customer service center technicians about why the RAM falls short? D:

Actually all official roms hang around 139-140 of available WM ram.. so we are talking of 116-117 MB of supposedly reserved RAM.

Wes, your tests and theories are very convincing and bright indeed, but i am not yet convinced of the 'good will' of samsung guys in this design, nor of the 'not likely to be ever be fixable' .

I have been talking to other WM experts, whose analysis on other related devices, like the OmniaPro, throw more or less similar conclusions: something wrong is going on with samsung guys in the WM-memory department.

The 'if they did it this way it must be the right way' argument is not valid at all. They can and DID make lot of design mistakes, all manufacturers do, both in hardware and software. Even long-running, experienced guys like HTC have been doing some things wrong, like the lots of issues of the flamant HD2..

Dont get me wrong Wes i admire and cheer your experiments, they seem to be on right trail, but i am more inclined to thing its all hard-coded in NK... i have good hopes on what cmonex can help with..

Link to comment
Share on other sites

Actually all official roms hang around 139-140 of available WM ram.. so we are talking of 116-117 MB of supposedly reserved RAM.

Wes, your tests and theories are very convincing and bright indeed, but i am not yet convinced of the 'good will' of samsung guys in this design, nor of the 'not likely to be ever be fixable' .

I have been talking to other WM experts, whose analysis on other related devices, like the OmniaPro, throw more or less similar conclusions: something wrong is going on with samsung guys in the WM-memory department.

The 'if they did it this way it must be the right way' argument is not valid at all. They can and DID make lot of design mistakes, all manufacturers do, both in hardware and software. Even long-running, experienced guys like HTC have been doing some things wrong, like the lots of issues of the flamant HD2..

Dont get me wrong Wes i admire and cheer your experiments, they seem to be on right trail, but i am more inclined to thing its all hard-coded in NK... i have good hopes on what cmonex can help with..

I would be happy to see more memory but as you can see from my tests, changing the value of end of ram in xip header and in imageinfo.bin (in .VM) moved the reserved memory value reported by Samsung. As far as, how much of spare RAM it is, we will never know. The fact is that I could read memory up to 0x91600000, Subtracting 0x80915000 (which is start of free RAM in xip header) gives you 275,372MB memory. Maybe 20MB out of that is PagePool, so that would leave you with 255,372MB. I hope that I am wrong. And looking at the picture that I posted adding reserved and in use to free gives you 256 as well. So, end of Ram is the value that Samsung takes into account for calculating reserved and free memory.

The other thing that I might try, would be after changing end of ram to lower value, dump memory again and see if similar data in memory is still in the same location or does it follow end of ram (I hope you understand what I mean). If it was still in the same location, maybe this memory value (memory that is used by Samsung for whatever reason, starts at a certain address) is hard coded in nk.exe. If it is, maybe changing this value (if we could find it) would work. But we don't know how much memory is needed for what Samsung is doing.

There is also description of nk.exe boot process at microsoft site http://msdn.microsoft.com/en-us/library/aa908987.aspx. One part that is interesting is about OEMAddressTable. Where is this located? Is it in XIP?

Rodrigo,

Maybe you could send a message to cmonex with what and how I did it. Maybe cmonex can have some opinion about it as well. Just a thought.

Edited by wes58
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.