View previous topic :: View next topic |
Author |
Message |
4nn13 Tux's lil' helper

Joined: 01 Sep 2023 Posts: 92
|
Posted: Tue Sep 05, 2023 6:11 pm Post subject: [solved]Application slowly launch at the first time |
|
|
All the applications are really slow to start at the first time, but the second time is really fast, anyone knows what is the problem?
envirment: X dwm
Last edited by 4nn13 on Thu Sep 14, 2023 2:49 pm; edited 1 time in total |
|
Back to top |
|
 |
sublogic Guru


Joined: 21 Mar 2022 Posts: 338 Location: Pennsylvania, USA
|
Posted: Tue Sep 05, 2023 9:29 pm Post subject: Re: Application slowly launch at the first time |
|
|
4nn13 wrote: | All the applications are really slow to start at the first time, but the second time is really fast, anyone knows what is the problem? | Just a guess: do you have lots of memory ?
On my desktop it takes SECONDS to load big applications from disk (I'm still on a disk). Firefox, for example. But once loaded they stay in the page cache forever and launch quickly from then on.
Run the vmstat in a separate terminal window. Look at the "bi" and "bo" columns (blocks in, blocks out) to check I/O activity. Launch a big slow-to-start application. Close and launch again. Any difference in I/O between the two runs ?
Code: | # echo 1 /proc/sys/vm/drop_caches | Do your big apps slow down again ? |
|
Back to top |
|
 |
4nn13 Tux's lil' helper

Joined: 01 Sep 2023 Posts: 92
|
Posted: Tue Sep 05, 2023 11:56 pm Post subject: Re: Application slowly launch at the first time |
|
|
sublogic wrote: | 4nn13 wrote: | All the applications are really slow to start at the first time, but the second time is really fast, anyone knows what is the problem? | Just a guess: do you have lots of memory ?
On my desktop it takes SECONDS to load big applications from disk (I'm still on a disk). Firefox, for example. But once loaded they stay in the page cache forever and launch quickly from then on.
Run the vmstat in a separate terminal window. Look at the "bi" and "bo" columns (blocks in, blocks out) to check I/O activity. Launch a big slow-to-start application. Close and launch again. Any difference in I/O between the two runs ?
Code: | # echo 1 /proc/sys/vm/drop_caches | Do your big apps slow down again ? |
I have 12G ram, and now the biggest application what I have on my laptop is Brave-bin browser
after reboot the system 1st time start applications : X lxterminal
Code: | $ ~ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 11619704 23880 273368 0 0 314 2 269 174 1 3 89 6 0 |
after close the browser
Code: | $ ~ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 13 0 10492736 32380 795488 0 0 568 29 288 282 2 4 78 16 0 |
restart again brave
Code: | $ ~ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
6 1 0 10570948 32840 808928 0 0 496 70 302 359 3 4 77 16 0 |
|
|
Back to top |
|
 |
szatox Advocate

Joined: 27 Aug 2013 Posts: 3656
|
Posted: Wed Sep 06, 2023 12:11 am Post subject: |
|
|
Do you also have system on HDD? Like in: spinning plates?
This is less visible on SSD, but linux does not remove cached disk reads from ram until it runs out of ram. You can see it with free:
Code: | $ LANG=C free -h
total used free shared buff/cache available
Mem: 15Gi 3.8Gi 3.3Gi 782Mi 7.6Gi 11Gi
| Those 7.6Gi under "buff/cache" makes system more responsive, but this data can be re-read from disk when required, so system will just release this memory, no questions asked, should any application request more space than "free" offers. |
|
Back to top |
|
 |
4nn13 Tux's lil' helper

Joined: 01 Sep 2023 Posts: 92
|
Posted: Wed Sep 06, 2023 1:17 am Post subject: |
|
|
szatox wrote: | Do you also have system on HDD? Like in: spinning plates?
This is less visible on SSD, but linux does not remove cached disk reads from ram until it runs out of ram. You can see it with free:
Code: | $ LANG=C free -h
total used free shared buff/cache available
Mem: 15Gi 3.8Gi 3.3Gi 782Mi 7.6Gi 11Gi
| Those 7.6Gi under "buff/cache" makes system more responsive, but this data can be re-read from disk when required, so system will just release this memory, no questions asked, should any application request more space than "free" offers. |
yes i have my system on hdd,
I ran only brave browser and I got 12Gram, I don't think the browser will take more than 2G ram, besides even starting small applications (like dwm st lxterminal etc...)they will also need to take a while to launch.
Code: | $ ~ free -h
total used free shared buff/cache available
Mem: 11Gi 1.2Gi 9.2Gi 242Mi 1.1Gi 9.9Gi
Swap: 0B 0B 0B |
|
|
Back to top |
|
 |
sublogic Guru


Joined: 21 Mar 2022 Posts: 338 Location: Pennsylvania, USA
|
Posted: Wed Sep 06, 2023 10:01 pm Post subject: Re: Application slowly launch at the first time |
|
|
4nn13 wrote: | Code: | $ ~ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 11619704 23880 273368 0 0 314 2 269 174 1 3 89 6 0 |
|
Sorry, I should have said:to repeat stats at one second intervals. Start the vmstat in a separate window, then launch the app under test. You will probably see a burst under "bi" as the application loads from disk. ^C to stop the vmstat.
(And you may see another burst when you close the app ! A bunch of code has to be paged back in to run all the destructors as the app cleans up. Or not, it depends on the app. The wonders of software engineering and of object-oriented programming, I guess.) |
|
Back to top |
|
 |
4nn13 Tux's lil' helper

Joined: 01 Sep 2023 Posts: 92
|
Posted: Thu Sep 14, 2023 2:48 pm Post subject: Re: Application slowly launch at the first time |
|
|
sublogic wrote: | 4nn13 wrote: | Code: | $ ~ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 11619704 23880 273368 0 0 314 2 269 174 1 3 89 6 0 |
|
Sorry, I should have said:to repeat stats at one second intervals. Start the vmstat in a separate window, then launch the app under test. You will probably see a burst under "bi" as the application loads from disk. ^C to stop the vmstat.
(And you may see another burst when you close the app ! A bunch of code has to be paged back in to run all the destructors as the app cleans up. Or not, it depends on the app. The wonders of software engineering and of object-oriented programming, I guess.) |
thanks a lot for the help, i've solved the problem by simply move my system to a SSD storage. |
|
Back to top |
|
 |
|