AX88U high RAM usage, maybe?

R G G

Regular Contributor
Need some help understanding why htop and the router's panel seem to be telling a different story. I have ample swap with amtm and entware running (1 active package –– conmon)

The problem goes away temporarily upon restart but resurfaces after a while.

386.4


router.png


htop.png
 
Last edited:

ColinTaylor

Part of the Furniture
This is not a problem. They are both showing the same thing. The GUI is saying that 97% of RAM has been allocated for use (including cache). htop shows the same information - the bar goes all the way to the right. Part of htop bar is in a different colour - this is the amount of used memory excluding cache and is the number shown to the right.
 

R G G

Regular Contributor
Part of htop bar is in a different colour - this is the amount of used memory excluding cache and is the number shown to the right.

So I take it this amount is reserved? I was just intrigued since I had never seen the router report anything over 70% for me, thought it might've been an issue with the new firmware.
 

ColinTaylor

Part of the Furniture
So I take it this amount is reserved?
There is no "reserved" memory. The colours on the bar represent:
  • Green: Used memory
  • Blue: Buffers
  • Orange: Cache
Every time your router reads or writes something to the USB drive it will cache that data in unused memory, until ~97% of memory is allocated. This is why "free" memory will decrease over time as more and more disk blocks are cached. The appropriate amount of cache memory will be instantly freed up should another process require more memory.
 
Last edited:

Makaveli

Very Senior Member
I actually find this firmware version using less memory and cache less than previous ones.

386.3_2

1641656922845.png


386.4

1641657009029.png
 

ColinTaylor

Part of the Furniture
I actually find this firmware version using less memory and cache less than previous ones.
As mentioned above, the vast majority of memory usage will be down to how the USB drive is being used rather than the firmware version.
 

Makaveli

Very Senior Member
As mentioned above, the vast majority of memory usage will be down to how the USB drive is being used rather than the firmware version.

And that usage hasn't changed for me between firmwares. And there is clearly a difference here my screenshot above speak for themselves.
 

ColinTaylor

Part of the Furniture
And that usage hasn't changed for me between firmwares. And there is clearly a difference here.
The cache usage will change over time as data is written or deleted from the USB drive. Given that you have some swap used I'd guess that a reasonably large file has been deleted from the USB drive (perhaps a temporary file) and that has freed up most of the cache.

You can see this behaviour yourself by creating and then deleting a large file on the USB drive.
Rich (BB code):
# free
             total       used       free     shared    buffers     cached
Mem:        934032     359068     574964       1688       1004      44524
-/+ buffers/cache:     313540     620492
Swap:            0          0          0

# dd if=/dev/zero of=/tmp/mnt/ClickUSB2/1GB-file bs=1k count=1048576
1048576+0 records in
1048576+0 records out

# free
             total       used       free     shared    buffers     cached
Mem:        934032     903796      30236       1680        404     561840
-/+ buffers/cache:     341552     592480
Swap:            0          0          0

# rm /tmp/mnt/ClickUSB2/1GB-file

# free
             total       used       free     shared    buffers     cached
Mem:        934032     334776     599256       1680        404      22152
-/+ buffers/cache:     312220     621812
Swap:            0          0          0
 

KMO

Occasional Visitor
TLDR - the "cache used" only indicates how much you've accessed the disc in the immediate past, and will change from second to second. There's no point doing any sort of comparison on it.

Given that, I'd say the GUI is being unhelpful here.

The graph shouldn't just be showing "used including cache", as there's no way to tell the difference between +200M in use (possibly bad) and +200M cached (absolutely fine). It should either omit the cache, or have two colours like htop. It's totally reasonable that a user should think like the OP that an increase could be a problem and be tempted to reboot.

(For comparison, Windows doesn't show standby (cache) memory in its simple Task Manager memory display, but does show it in its multicoloured Resource Monitor display, like htop).

And the table should have an "In use" row. A user can figure out how much is in use by calculating "Total - Free - Cache - Buffers", but it should be easier than that. "In use" would be more useful than any of "Free", "Cache" or "Buffers" as they stand, and would allow the sort of comparison the OP wants to do. (The current "Free" isn't that useful as it mainly indicates lack of cache use.)
 
Last edited:

ColinTaylor

Part of the Furniture
And the table should have an "In use" row. A user can figure out how much is in use by calculating "Total - Free - Cache - Buffers", but it should be easier than that. "In use" would be more useful than any of "Free", "Cache" or "Buffers" as they stand, and would allow the sort of comparison the OP wants to do. (The current "Free" isn't that useful as it mainly indicates lack of cache use.)
Agreed. RMerlin has speculated in the past about changing the "free memory" shown to something more understandable because he was fed up with people asking this same question over and over again. It's a shame he never did that.
 

Makaveli

Very Senior Member
The cache usage will change over time as data is written or deleted from the USB drive. Given that you have some swap used I'd guess that a reasonably large file has been deleted from the USB drive (perhaps a temporary file) and that has freed up most of the cache.

That happened when updating the firmware as the cache goes back to 0. However what I noticed in the same time frame so about 5 days up time i'm sitting with about 450+ free ram. By the same 5 days on the pervious firmware that would have all been cached and I would be 30-50mb free memory. I will watch it over the next couple weeks so see if its any different.

Obviously not an issue since unused ram is wasted ram just an observation.
 

ColinTaylor

Part of the Furniture
That happened when updating the firmware as the cache goes back to 0. However what I noticed in the same time frame so about 5 days up time i'm sitting with about 450+ free ram. By the same 5 days on the pervious firmware that would have all been cached and I would be 30-50mb free memory. I will watch it over the next couple weeks so see if its any different.

Obviously not an issue since unused ram is wasted ram just an observation.
I've just remembered that when you initially log into the GUI (and subsequent logins at least 10 minutes apart) the router will flush the cache. So that's probably why you're mostly seeing low cache usage in the GUI. I don't remember this happening in the past.

 
Last edited:

KMO

Occasional Visitor
Heh, that's one way to sort out the memory graph. :oops: Could that be the only reason that's there?
 

ColinTaylor

Part of the Furniture
Could that be the only reason that's there?
I did wonder that myself.

But I suppose one might argue that if you're logging into the GUI you could be making changes that restart services, or even doing a firmware update. In those situations maximising the amount of free memory might avoid problems.
 

KMO

Occasional Visitor
That would suggest a lack of faith in the operating system doing its job.

Anyway, I've made a PR improving the memory display, making it resemble htop more.

(Although htop has its own issues, and has changed behaviour a few times recently - I've submitted a PR there too).
 

ColinTaylor

Part of the Furniture
Anyway, I've made a PR improving the memory display, making it resemble htop more.
If you're going to all that effort perhaps you could have a look at this other GUI problem? ;)


The amount of swap space available (and I suppose being used) is being truncated to a 32-bit unsigned integer.
 

KMO

Occasional Visitor
Yeah, I noticed the 32-bit truncation reading the code, but assumed we weren't hitting it yet. Forgot the swap space could be bigger than 4GiB. Sure, I can fix that.
 

AntonK

Very Senior Member
I don't know if the ScMerlin script is any help to this thread's discussion of memory. But below is the view you get from it's display (memory) on the router's WebUI.

Scmerlin.jpg
 

Makaveli

Very Senior Member
I'm now 11 days in on this firmware and free memory is still at 500mb's which was never the case with any previous version so just an fyi

1642102039797.png
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top