Application and Database Advise
Posted
#1
(In Topic #1350)
Enthusiast

Just wanted to pick your experts brains on something.
I'm having some system issues with my current software every 24-72 hours the software just slows down so much but I am not sure why as I only open the connects to the the database as and when needed and once I'm doing with them I close them.
And when the terminal go to sleep and is woken up again the software crawls (you can press sign on and it take 45-50 seconds for the sign on screen to show)
So could my issues be what is running in the background.
I have the following running on the pos
Xfce desktop (and some machines run just x11)
MySQL full database server
My printer controller program
My customer display control program
My status program (printer open etc)
My database sync program (only kicks in when it detects a update to the updatetable on the server)
And of course the pos application.
The pos database hold everything that is downloaded from the main server at boot up (I have a small sync program that does this)
I have been thinking about remove the MySQL server from the PoS Terminals and using something else that would be a lot lighter but I would need to make sure that I could have 2 programs access the database at any time (they would be the PoS itself and the sync program)
Can SQLite do this or would it be best to just stick with MySQL?
I have been told about these issues by 2 customers (and the software is running on 2 different machine but they are running on xfce debian 12)
I welcome any ideas as how to sort the slowing of the program and the database side (I could be on the totally wrong path here but I need to start somewhere)
Posted
Administrator

You think that would be an option?
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Enthusiast

gbWilly said
Instead of letting us guess what might be wrong based on your assumptions, have you tried monitoring the systems and see what is eating up memory or cpu time.
You think that would be an option?
This is why I'm asking for advise as I have no idea how to show that information on Linux
I have used the top command is that the one I need to use?
Posted
Administrator

Luckily DuckDuckGo came up with multiple ideas to the question: how to monitor performance issues linuxAndyGable said
This is why I'm asking for advise as I have no idea how to show that information on Linux
1. https://www.tecmint.co…onitor-linux-performance/
2. https://geekflare.com/linux-performance-commands/
3. https://serverauth.com…ing-a-comprehensive-guide
Just the 3 first ideas of DuckDuckGo…
There where many more…
Enjoy…
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Regular

AndyGable said
And when the terminal go to sleep and is woken up again the software crawls (you can press sign on and it take 45-50 seconds for the sign on screen to show)
So could my issues be what is running in the background.
As a sheer blind guess I'd say you are on the completely wrong track.
When a program goes to sleep, its active memory becomes available for other processes to use and they will progressively use more and more. Closing database connections frequently is one way of achieving this as every time you re-open the connection it will grab new memory to process cursors, sorts, etc etc.
When your program re-awakes it has to get all its active memory back which can take some time depending on how much has been re-used by something else.
Don't bother running a memory usage utility and reporting back that only a few % of memory is used. That means nothing regarding this. How and when memory is swapped out is entirely a matter for the operating system.
How much of your data is held in active memory? Why? How many images/pictures? How are you using them, as Pictures or Images?
Swapping to sqlite will only make things worse. It is a memory based dbms.
b
Posted
Enthusiast

How much of your data is held in active memory? Why? How many images/pictures? How are you using them, as Pictures or Images?thatbruce said
As a sheer blind guess I'd say you are on the completely wrong track.
When a program goes to sleep, its active memory becomes available for other processes to use and they will progressively use more and more. Closing database connections frequently is one way of achieving this as every time you re-open the connection it will grab new memory to process cursors, sorts, etc etc.
When your program re-awakes it has to get all its active memory back which can take some time depending on how much has been re-used by something else.
Don't bother running a memory usage utility and reporting back that only a few % of memory is used. That means nothing regarding this. How and when memory is swapped out is entirely a matter for the operating system.
How much of your data is held in active memory? Why? How many images/pictures? How are you using them, as Pictures or Images?
Swapping to sqlite will only make things worse. It is a memory based dbms.
b
No data is stored in active Memory (to my knowledge) everything is stored and recalled from the database, images IF they are used are stored as BASE64 text and is converted by the software once it has been recalled from the database
From what I have just read i fell that I could be doing my Database connections wrong as at the moment i am opening the connection to the database, doing what i need with the Database and then closing the connection
Should I instead open the connection at the start of the program and keep the same one open all the time and close it when my app exit? (I do have another Database application that access the same database on the local machine (this app is used to keep the local database in sync with the Main mysql database Server - would I need to update this as well to open the connection when starting and not close it until the app exits?)
Also I have noticed when the System it self turns off the screen (blanks it and then powers it down) it take for ever for my Gambas app to respond (if it does most of the time I have to reboot the system)
The tills are as follows
Toshiba ST-A10 2GB RAM 2GHz CPU running Debian 12 With XFCE desktop
Epson TM-88 Thermal Printer
When the system boot it created a 20mb RAM folder so the interface modules (my apps that control hardware etc) can talk and not over work the SSD that i have put in the machine
right now I can not connect to the Machine EVEN though I can see it online on my AnyDesk portal (it even slows that down to a point where it times out from the connections but once reboot everything works fine for 2-3 days and then it happens all over again)
Does anyone know of a command I can use that would log application memory etc to a file so when I have to reboot I can see what was the last data before the reboot
As I am not sure if it MySQL or my own Gambas applications that is doing this.
Andy
Posted
Guru

<IMG src="https://community.linuxmint.com/img/screenshots/xfce4-taskmanager.png">
</IMG>
Posted
Administrator

Posted
Regular

AndyGable said
How much of your data is held in active memory? Why? How many images/pictures? How are you using them, as Pictures or Images?
No data is stored in active Memory (to my knowledge) everything is stored and recalled from the database, images IF they are used are stored as BASE64 text and is converted by the software once it has been recalled from the database
That's not what I meant. From what I've seen most POS systems display grids of pretty pictures of cheese, chalk, cabbages etc to the operator. For that to happen, they must be in memory (whether that is core or GPU). So how much image information is in memory while the program is running. How they are stored is immaterial.
From what I have just read i fell that I could be doing my Database connections wrong as at the moment i am opening the connection to the database, doing what i need with the Database and then closing the connection
Should I instead open the connection at the start of the program and keep the same one open all the time and close it when my app exit? Yes! Let the dbms manage and reuse its own memory (as most genuine rdbms do these days even pschatk MySQL. Also you could learn how the dbms does reuse memory for its caches, cursors etc and maybe there is some tuning that can be done. Otherwise, every time you open the connection, it will have to create a new area to manage that client. Depending on mystical things inside the O/S like "staleness" negotiation of the memory allocations can take a finite time. Not much but depending on the number of re-connections per minute it can add up. There is no reason to work this way. This bit is not true but think about it this way. Suppose your system closed down the filesystem every time you close all the files that you are using. Then you re-open a file so the system has to start up the filesystem again. Crazy eh!
(I do have another Database application that access the same database on the local machine (this app is used to keep the local database in sync with the Main mysql database Server - would I need to update this as well to open the connection when starting and not close it until the app exits?) That's a bit different. It would depend on how frequently the synching occurs. Once a minute? Several times a day? Once a month? Every Michaelmas? But within the sync app, I'd keep it open while it does its work and only close it when it is really not doing anything. However I dont think that the memory usage for this on the local system would be a large part of your problem. Now the memory on the central server may be a different matter.
Also I have noticed when the System it self turns off the screen (blanks it and then powers it down) it take for ever for my Gambas app to respond (if it does most of the time I have to reboot the system)
How is it arriving at the decision to "turn off the screen"? IOW what deamon is monitoring usage and turning off screen power? The system itself isn't going into some sleep mode too, is it? And God forbid it's not "hibernating" or some such silliness.
When the system boot it created a 20mb RAM folder so the interface modules (my apps that control hardware etc) can talk and not over work the SSD that i have put in the machine How have you achieved this? I doubt this is part of the issue, just interested.
right now I can not connect to the Machine EVEN though I can see it online on my AnyDesk portal (it even slows that down to a point where it times out from the connections but once reboot everything works fine for 2-3 days and then it happens all over again) No idea. Never used it. I only ever ssh into remotes. Is it as good as sliced bread?
Does anyone know of a command I can use that would log application memory etc to a file so when I have to reboot I can see what was the last data before the reboot
None that I can think of, sorry.
As I am not sure if it MySQL or my own Gambas applications that is doing this.
My money is on "Itsalottathings"
Someone mentioned using top. It's a very sophisticated tool that may give you some vision. Print the man page - there is tooo much to comprehend reading it on the screen. Then understand the Linux memory and process management parts so you can see what to display.
hth
b
Posted
Enthusiast

thatbruce said
Someone mentioned using top. It's a very sophisticated tool that may give you some vision. Print the man page - there is tooo much to comprehend reading it on the screen. Then understand the Linux memory and process management parts so you can see what to display.
hth
b
Hi B,
Below are my reply's to your questions
That's not what I meant. From what I've seen most POS systems display grids of pretty pictures of cheese, chalk, cabbages etc to the operator. For that to happen, they must be in memory (whether that is core or GPU). So how much image information is in memory while the program is running. How they are stored is immaterial.
Yes I do this myself I use the load from string function for the picturebox and load the image to that.
Yes! Let the dbms manage and reuse its own memory (as most genuine rdbms do these days even pschatk MySQL. Also you could learn how the dbms does reuse memory for its caches, cursors etc and maybe there is some tuning that can be done. Otherwise, every time you open the connection, it will have to create a new area to manage that client. Depending on mystical things inside the O/S like "staleness" negotiation of the memory allocations can take a finite time. Not much but depending on the number of re-connections per minute it can add up. There is no reason to work this way. This bit is not true but think about it this way. Suppose your system closed down the filesystem every time you close all the files that you are using. Then you re-open a file so the system has to start up the filesystem again. Crazy eh!
Thats ok I shall update the code to just open the database connection at Boot and then close it when exits
That's a bit different. It would depend on how frequently the synching occurs. Once a minute? Several times a day? Once a month? Every Michaelmas? But within the sync app, I'd keep it open while it does its work and only close it when it is really not doing anything. However I dont think that the memory usage for this on the local system would be a large part of your problem. Now the memory on the central server may be a different matter.
The app polls a table on the main database called updateTable and if it finds anything it will process that function. It does this pooling every 60 seconds but this can be changed
How is it arriving at the decision to "turn off the screen"? IOW what deamon is monitoring usage and turning off screen power? The system itself isn't going into some sleep mode too, is it? And God forbid it's not "hibernating" or some such silliness.
in my start up scripit I have the following
Code
#!/bin/bash
#Action to be for running PoS System
xset s off
xset s noblank
xset -dpms s off
#Closes the XFCE Panels
killall xfce4-panelEverything online says the xset stuff should turn off the sleep of the screen etc but I can confirm it does not work (I am going to need to find a better way to control it - AS I have a full Desktop install I may start to use the Display control program in settings)
How have you achieved this? I doubt this is part of the issue, just interested.
This is from my Start up scripit that does the RAM Drive setup
Code (gambas)
- RAMSIZE=20M
- echo 'Creating ' $RAMSIZE'B RAM Drive'
- sudo mount -t tmpfs -o size=$RAMSIZE tmps /algPoS/AppLink
No idea. Never used it. I only ever ssh into remotes. Is it as good as sliced bread?
I use AnyDesk on all my GUI PoS terminals it allows me easier access to update the applications and get backups of the databases etc
None that I can think of, sorry.
No worries I am just grateful that I can bounce Ideas off people who know Linux a little better then myself.
My money is on "Itsalottathings"
I have the same feeling but I need to sort this soon as I can not really release a slow commercial program
Just incase anyone wants to see how we start our systems I have included all 3 scripits
Startup.sh
RAMDrive.sh
Code (gambas)
- RAMSIZE=20M
- echo 'Creating ' $RAMSIZE'B RAM Drive'
- sudo mount -t tmpfs -o size=$RAMSIZE tmps /algPoS/AppLink
PoSStartUp.sh
Code (gambas)
- clear
- echo 'System Started' $BootedDate
- echo 'Starting ESC/PoS Printer Module'
- sudo chmod +x /algPoS/Apps/PoSPrinter/PoSPrinter.gambas
- sleep 5
- clear
- echo 'System Started' $BootedDate
- echo 'Starting ESC/PoS Printer Module DONE'
- echo 'Starting Epson Status Module'
- sudo chmod +x /algPoS/Apps/StatusModule/EpsonStatus.gambas
- sleep 5
- clear
- echo 'System Started' $BootedDate
- echo 'Starting ESC/PoS Printer Module DONE'
- echo 'Starting Epson Status Module DONE'
- echo 'Starting Toshiba LIUST-51 Line Display Controler Module'
- sudo chmod +x /algPoS/Apps/LIUST/LIUST.gambas
- sleep 5
- clear
- echo 'System Started' $BootedDate
- echo 'Starting ESC/PoS Printer Module DONE'
- echo 'Starting Epson Status Module DONE'
- echo 'Starting Toshiba LIUST-51 Line Display Controler Module DONE'
- echo 'Syncing PoS Database With System Database Please wait...'
- sudo chmod +x /algPoS/Apps/DataSync/DatabaseSync.gambas
- sleep 5
- clear
- echo 'System Started' $BootedDate
- echo 'Starting ESC/PoS Printer Module DONE'
- echo 'Starting Epson Status Module DONE'
- echo 'Starting Toshiba LIUST-51 Line Display Controler Module DONE'
- echo 'Syncing PoS Database With System Database COMPLETED'
- echo 'Starting Database Sync program in Request mode'
- sudo chmod +x /algPoS/Apps/DataSync/DatabaseSync.gambas
- sleep 2
- clear
- echo 'System Started' $BootedDate
- echo 'Starting ESC/PoS Printer Module DONE'
- echo 'Starting Epson Status Module DONE'
- echo 'Starting Toshiba LIUST-51 Line Display Controler Module DONE'
- echo 'Syncing PoS Database With System Database COMPLETED'
- echo 'Starting Database Sync program in Request mode DONE'
- echo 'Starting Data File Processor'
- sudo chmod +x /algPoS/Apps/DataProcessor/DataProcessor.gambas
- sleep 5
- clear
- echo 'System Started' $BootedDate
- echo 'Starting ESC/PoS Printer Module DONE'
- echo 'Starting Epson Status Module DONE'
- echo 'Starting Toshiba LIUST-51 Line Display Controler Module DONE'
- echo 'Syncing PoS Database With System Database COMPLETED'
- echo 'Starting Database Sync program in Request mode DONE'
- echo 'Starting Data File Processor DONE'
- echo 'Starting BasicRetail Point of sale Software'
- #sudo chmod +x /algPoS/Apps/RetailPoS/RetailPoS.gambas
- #This part will keep a eye out incase the PoS application crashes it will restart it
- echo 'RetailPoS has exited with a error code $?. Restarting now..' >&2
- sudo chmod +x /algPoS/Apps/RetailPoS/RetailPoS.gambas
- sleep 1
- done
Posted
Guru

Code
until RetailPoS; do
echo 'RetailPoS has exited with a error code $?. Restarting now..' >&2
sudo chmod +x /algPoS/Apps/RetailPoS/RetailPoS.gambas
/algPoS/Apps/RetailPoS/RetailPoS.gambas /fullscreen /nomouse > /dev/null 2>&1
sleep 1
doneuntil should work on a "condition" I can't quite see what "until RetailPos;" is evaluating?
maybe try pgrep -f to check if a program is running
something like this…
Code
until [ -n $(pgrep -f RetailPoS) ]; do
echo 'RetailPoS has exited with a error code $?. Restarting now..' >&2
sudo chmod +x /algPoS/Apps/RetailPoS/RetailPoS.gambas
/algPoS/Apps/RetailPoS/RetailPoS.gambas /fullscreen /nomouse > /dev/null 2>&1
sleep 1
done
Posted
Enthusiast

BruceSteers said
Code
until [ -n $(pgrep -f RetailPoS) ]; do
echo 'RetailPoS has exited with a error code $?. Restarting now..' >&2
sudo chmod +x /algPoS/Apps/RetailPoS/RetailPoS.gambas
/algPoS/Apps/RetailPoS/RetailPoS.gambas /fullscreen /nomouse > /dev/null 2>&1
sleep 1
done
Hi Bruce,
That stops my complete script if I exit out of my app (so that works i just need to see if I can force a crash of the app to see if it will reload the app)
I have also been doing some digging and it seems that my actual RetailPoS application is growing in memory every minute
When it starts up it is at 47.1MB in memory but after 2 mins it has gone to 76.3MB and all the app is doing is sitting on a "Closed" Screen
Below is the Code for my frmbackground (this is the main form showing)
I have 2 timers on this form one to display the time and date and the other handles files coming in from the add on modules (timer2)
Code (gambas)
- ' Gambas class file
- frmbackground.SetFocus
- frmbackground.Stacking = 1
- frmbackground.SetFocus
- 'Loads the PoS Settings etc
- BootUp.PoSBootup
- 'Hide / Show Buttons
- btnUpArrow.Height = 98
- btnDownArrow.Height = 98
- btnUpArrow.Height = 147
- btnDownArrow.Height = 147
- btnLotteryPayout.Show
- btnLotteryPayout.hide
- btnPriceCheck.Show
- btnPriceCheck.Hide
- btnPriceOverride.Show
- btnPriceOverride.Hide
- btnDepartmentList.Show
- btnDepartmentList.Hide
- btnPriceOverride.Height = 98
- btnQty.Show
- btnQty.Hide
- btnSignOnOff.Width = 276
- btnSignOnOff.Width = 189
- btnSignOnOff.Width = 94
- With btnSignOnOff
- .Width = 94
- .x = 0
- .y = 448
- btnUpArrow.Height = 196
- btnDownArrow.Height = 196
- Case "Request"
- Case "AtEnd"
- 'Connects to the PoS Database Server and ready the PoS for use
- BackofficeDatabase.ConnectToBackOfficeDatabase("Open")
- DatabaseModule.ConnectToDatabase("Open")
- MenuDisplay.ClearMenu
- With Timer1
- .Delay = 1000
- .Start
- With Timer2
- .Delay = 1
- .Start
- Workspace1.Add(frmSignedOff, 0)
- Workspace1.SetFocus
- ' If Auto End of day is swiched On this will Process it
- SystemModule.StartAEOD
- SystemModule.StartAEOD
- global.StartEOD = 0
- 'tests for the Feed from the DataProcessor App
- Case "NoNetwork"
- Case "Network"
- KeyArrowUp.ProcessKey(Workspace1.ActiveWindow.Name)
- Global.pc = Picture.FromString(File.Load(Application.Path &/ "AppImages/RedBackground/upArrow_red.bmp"))
- btnUpArrow.Background = Color.Red
- Global.pc = Picture.FromString(File.Load(Application.Path &/ "AppImages/GreyBackground/upArrow.bmp"))
- btnUpArrow.Background = Color.LightGray
- KeyArrowDown.ProcessKey(Workspace1.ActiveWindow.Name)
- btnDownArrow.Background = Color.Red
- Global.pc = Picture.FromString(File.Load(Application.Path &/ "AppImages/RedBackground/downArrow_red.bmp"))
- Global.pc = Picture.FromString(File.Load(Application.Path &/ "AppImages/GreyBackground/downArrow.bmp"))
- btnDownArrow.Background = Color.LightGray
- global.JobNumber = frmSalescreen.labInputText.Caption
- frmbackground.btnEnterJobNumber.Caption = "Job Number " & global.JobNumber
- frmbackground.btnEnterJobNumber.Caption = "Job Number"
- '
- KeySignOnOff.ProcessKey(Workspace1.ActiveWindow.Name)
- btnSignOnOff.Background = Color.Red
- btnSignOnOff.Background = Color.White
- KeyLotteryPayout.ProcessKey(Workspace1.ActiveWindow.Name)
- btnLotteryPayout.Background = Color.Red
- btnLotteryPayout.Background = Color.White
- KeyPriceCheck.ProcessKey(Workspace1.ActiveWindow.Name)
- btnPriceCheck.Background = Color.Red
- btnPriceCheck.Background = Color.White
- KeyPriceOverride.ProcessKey(Workspace1.ActiveWindow.Name)
- btnPriceOverride.Background = Color.Red
- btnPriceOverride.Background = Color.White
- KeyUserMenu.ProcessKey(Workspace1.ActiveWindow.Name)
- btnUserMenu.Background = Color.Red
- btnUserMenu.Background = Color.White
- KeyVoidMenu.ProcessKey(Workspace1.ActiveWindow.Name)
- btnItemMenu.Background = Color.Red
- btnItemMenu.Background = Color.White
- KeyDepartmentList.ProcessKey(Workspace1.ActiveWindow.Name)
- btnDepartmentList.Background = Color.Red
- btnDepartmentList.Background = Color.White
- KeyPrintRecipt.ProcessKey(Workspace1.ActiveWindow.Name)
- btnPrintRecipt.Background = Color.Red
- btnPrintRecipt.Background = Color.White
- KeyQty.ProcessKey(Workspace1.ActiveWindow.Name)
- btnQty.Background = Color.Red
- btnQty.Background = Color.White
- KeyClear.ProcessKey(Workspace1.ActiveWindow.Name)
- btnClear.Background = Color.Red
- btnClear.Background = Color.White
- KeyTotal_No.Processkey(Workspace1.ActiveWindow.Name)
- btnTotalNo.Background = Color.Red
- btnTotalNo.Background = Color.White
- KeyEnter_Yes.ProcessKey(Workspace1.ActiveWindow.Name)
- btnEnterYes.Background = Color.Red
- btnEnterYes.Background = Color.White
- 'Number Keys#
- Key_0.ProcessKey(Workspace1.ActiveWindow.Name)
- btn0.Background = Color.Red
- btn0.Background = Color.White
- KeyDOT.ProcessKey(Workspace1.ActiveWindow.Name)
- btnDot.Background = Color.Red
- btnDot.Background = Color.White
- Key_1.ProcessKey(Workspace1.ActiveWindow.Name)
- btn1.Background = Color.Red
- btn1.Background = Color.White
- Key_2.ProcessKey(Workspace1.ActiveWindow.Name)
- btn2.Background = Color.Red
- btn2.Background = Color.White
- Key_3.ProcessKey(Workspace1.ActiveWindow.Name)
- btn3.Background = Color.Red
- btn3.Background = Color.White
- Key_4.ProcessKey(Workspace1.ActiveWindow.Name)
- btn4.Background = Color.Red
- btn4.Background = Color.White
- Key_5.ProcessKey(Workspace1.ActiveWindow.Name)
- btn5.Background = Color.Red
- btn5.Background = Color.White
- Key_6.ProcessKey(Workspace1.ActiveWindow.Name)
- btn6.Background = Color.Red
- btn6.Background = Color.White
- Key_7.ProcessKey(Workspace1.ActiveWindow.Name)
- btn7.Background = Color.Red
- btn7.Background = Color.White
- Key_8.ProcessKey(Workspace1.ActiveWindow.Name)
- btn8.Background = Color.Red
- btn8.Background = Color.White
- Key_9.ProcessKey(Workspace1.ActiveWindow.Name)
- btn9.Background = Color.Red
- btn9.Background = Color.White
- FunctionKeyF1.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- FunctionKeyF2.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- FunctionKeyF3.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- FunctionKeyF4.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- FunctionKeyF5.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- FunctionKeyF6.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- FunctionKeyF7.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- FunctionKeyF8.ProcessFunctionKey(Workspace1.ActiveWindow.Name)
- Case "Yes"
- PrinterFunctions.WithThanks
- PrinterFunctions.JobNumberPrint
- Case "No"
- PrinterFunctions.WithThanks
- global.algPoSCount += 1
- MenuDisplay.ClearMenu
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(frmalgPoSMenu, 0)
- global.algPoSCount = 0
- MenuDisplay.ClearMenu
- MenuDisplay.SignedOffSystemMenu
and the code for the frmsigned off
Code (gambas)
- ' Gambas class file
- With frmbackground
- .btnSignOnOff.Caption = "Sign On"
- global.CustomerDisplayFunction("SignedOff")
- Me.SetFocus
- labCopyrightMessage.Caption = Global.CopyrightValue
- MenuDisplay.ClearMenu
- With frmbackground
- .btnTotalNo.Caption = "Total"
- .btnEnterYes.Caption = "Enter"
- frmbackground.Workspace1.CloseAll
- Case "Number"
- frmbackground.Workspace1.Add(FrmSignOn, 0)
- Case "List"
- DatabaseModule.LoadCashierNamesOnScreen
- frmbackground.Workspace1.Add(FrmSignOnList, 0)
- Case Global.Key_PriceCheck
- global.PriceCheckReturnScreen = "frmSignedOff"
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(frmPriceCheck_1, 0)
- Case Global.Key_UserMenu
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(frmSignedOffMenu, 0)
frmSignedoff is showing inside a workspace on frmBackground (the full app is based on a workspace holder)
Is there a way I can see what my app is placing into memory all the time as I have checked my code and I can not see what is happening (and I have rewitten the database interface modules so it opens the connection at start of the program and not to close them until the end of the program)
This is what this section does
Code (gambas)
- 'Connects to the PoS Database Server and ready the PoS for use
- BackofficeDatabase.ConnectToBackOfficeDatabase("Open")
- DatabaseModule.ConnectToDatabase("Open")
Posted
Regular

I don't know if it will help but I think setting visible on and off involves less effort than Show/Hide. You'd need to look at what happens inside the GUI to find out how they are different, probably easier just to try.
b
p.s. By the way, from what I said before, just because a control is hidden doesn't mean it is not using memory, so if any of those controls have images/pictures in them they are loaded, no matter if they are visible.
Posted
Regular

How is it arriving at the decision to "turn off the screen"? IOW what deamon is monitoring usage and turning off screen power? The system itself isn't going into some sleep mode too, is it? And God forbid it's not "hibernating" or some such silliness.
in my start up scripit I have the following
Everything online says the xset stuff should turn off the sleep of the screen etc but I can confirm it does not work (I am going to need to find a better way to control it - AS I have a full Desktop install I may start to use the Display control program in settings)
Try using
Code (gambas)
- xset -dpms
I tried out your xsets in a terminal here. The first tWo don't affect dpms but that simplified 3rd line does work here.
b
Now, lets get back to the actual dpms itself. I presume you are using xfce4-power-manager? What are the settings there? Particularly the System ones.
Posted
Regular

Posted
Regular

Key.Code is an integer value. I see no need to waste time converting it to a string internally.
Use
Posted
Regular

Did it make a difference? You may need a decent dbms monitor like dBeaver or something to see it. I think MySQL has a html front end but I have no idea how sophisticated it is.(and I have rewitten the database interface modules so it opens the connection at start of the program and not to close them until the end of the program)
b
Posted
Enthusiast

thatbruce said
AlsoFrom the top.
Key.Code is an integer value. I see no need to waste time converting it to a string internally.
Use
The keys are stored in the system as numbers but stored as string. Should I change them to be integers?
Posted
Enthusiast

thatbruce said
Did it make a difference? You may need a decent dbms monitor like dBeaver or something to see it. I think MySQL has a html front end but I have no idea how sophisticated it is.(and I have rewitten the database interface modules so it opens the connection at start of the program and not to close them until the end of the program)
b
Yes it did the database has not gone over 15mb memory usage yet
Posted
Enthusiast

But on the customers machine it has gone to 120mb
The only difference is I have on my machine 3.19.5 and on the customers machine is installed 3.19.4 runtime files.
Could the different versions be playing a part in this?
Posted
Enthusiast

thatbruce said
How is it arriving at the decision to "turn off the screen"? IOW what deamon is monitoring usage and turning off screen power? The system itself isn't going into some sleep mode too, is it? And God forbid it's not "hibernating" or some such silliness.
in my start up scripit I have the following
Everything online says the xset stuff should turn off the sleep of the screen etc but I can confirm it does not work (I am going to need to find a better way to control it - AS I have a full Desktop install I may start to use the Display control program in settings)
Try usingYou can see if this works in a terminal by using "xset q" before and after the above as it takes effect immediately.Code (gambas)
xset -dpms
I tried out your xsets in a terminal here. The first tWo don't affect dpms but that simplified 3rd line does work here.
b
Now, lets get back to the actual dpms itself. I presume you are using xfce4-power-manager? What are the settings there? Particularly the System ones.Power Manager_001.png
Once I'm at the customers machine this afternoon I shall let you know the settings
Posted
Regular

<COLOR color="#BF0080">(OOPS, this needs a quote so I and you need to know what we are talking about here. I'll be back after a little lie down now.)</COLOR>
One monitor I have looked at here today is vmstat. It does seem to give better information that may provide some pertinent data. You will need to run the following on a live pos for an entire day, which will give a LOT of data we need to look at.
On a POS in a virtual terminal run this after starting the pos system. Let it run for an entire day
vmstat -w -n 30 103680 -Sm
This will generate a big output to stdout, so you need to copy it somehow (piping doesn't seem to oblige vmstat, unless someone can convince me otherwise.) The things we are interested in are the swap values which might get us a little further.
Posted
Enthusiast

thatbruce said
Severely doubt it.
<COLOR color="#BF0080">(OOPS, this needs a quote so I and you need to know what we are talking about here. I'll be back after a little lie down now.)</COLOR>
One monitor I have looked at here today is vmstat. It does seem to give better information that may provide some pertinent data. You will need to run the following on a live pos for an entire day, which will give a LOT of data we need to look at.
On a POS in a virtual terminal run this after starting the pos system. Let it run for an entire day
vmstat -w -n 30 103680 -Sm
This will generate a big output to stdout, so you need to copy it somehow (piping doesn't seem to oblige vmstat, unless someone can convince me otherwise.) The things we are interested in are the swap values which might get us a little further.
This has been set up on the customers machine
I've also checked and the setting for the display etc are all set off.
Posted
Enthusiast

just wanted to ask a silly question while I am still getting the Memory data files for you as you have requested
Why in the xfce4-taskmanager does it show my app as org.gambas. then the PID and not the application name?
Do I need to change a setting somewhere so this can be seen?
Also I have done the following in my code
Delete every time I close the database connection and now it opens when it boot up and then closes when it exits
set all DataResult to null when I am done with them
set all global.pc (picture) as null when I am done once they have all loaded onto the from
And on my development PC my memory usage sits around 55MB but on the actual customers machine it starts at 49.4MB and it keeps increasing by 0.02MB every 2 seconds
SO I am not sure what else to search for when I am looking for memory usage now
Posted
Enthusiast

Well I tried a little experiment on the customers machine just now and I shit you not i have the software sitting happily at 52.5MB of RAM usage
ALL I did was NOT launch the PoS application from the boot up script
SO does anyone know how I can still use my start up script to start my apps BUT not have them spawn from the script (as I think that is what is making it use memory)
I am thinking about making a small start up program in Gambas to launch a list of set programs and then exit (is this a good idea or should i stick with the bash scripit but make it work)
1 guest and 0 members have just viewed this.



