MarcusWolschon / osmeditor4android

Vespucci is a OpenStreetMap editor for Android

Home Page:http://vespucci.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vespucci close after creating new wms layer.

afgb1977 opened this issue · comments

After creating a new wms layer with orthophotos, Vespucci is completely gone. I only get an empty screen.
I have closed and opened Vespucci, but it does not restart correctly.
I don't want to delete all the data and lose my settings, I will reinstall the previous version.
The following screenshots show the sequence of what happens=

  1. I open Vespucci.
    IMG_20230824_232754_372

  2. After 5 seconds it goes to the error reporting screen.
    IMG_20230824_232759_414

  3. When I try to write, Vespucci jumps to the last completely empty screen.
    IMG_20230824_232803_491

Vespucci version = Apk downloaded from Github, vespucci-19.2-BETA-1-signed

Can you pls detail what device you are using and Android version? Did you submit the crash dump? Note that you can normally not downgrade., given that the crash is linked to an WMS entry, have you tried switching to airplane mode before trying to run the app?

Can you pls detail what device you are using and Android version? Did you submit the crash dump? Note that you can normally not downgrade., given that the crash is linked to an WMS entry, have you tried switching to airplane mode before trying to run the app?

Nokia G50 (TA1367)
Android 13

I just realized that I can't install a version older than the current one.
Also try to reboot Vespucci with "Airplane Mode" On, it didn't work.
Will I have to delete all data and start configuration from scratch again?
Would it be possible to add an option to save settings and map/layer sources so I don't have to start from scratch?

Found it. So the problem is that the app is running out of memory decoding/rendering a tile from the WMS server and that tile has already been downloaded and is in the tile cache (it is actually the SQLite code running out of memory trying to get the tile from the cache). You should be able to recover by deleting the tile cache and using airplane mode.

To delete the tile cache, see: http://vespucci.io/tutorials/faq/#other-tile-database-related-issues

In any case could you give me the URL you entered for the WMS server? It is definitely returning something weird.

Comment
Vespucci has closed after trying to set up a new wms layer
De-obfuscated Stacktrace
java.lang.OutOfMemoryError: Failed to allocate a 32 byte allocation with 3004784 free bytes and 2934KB until OOM, target footprint 536870912, growth limit 536870912; giving up on allocation because <1% of heap free after GC.
	at android.database.sqlite.SQLiteConnection.nativeExecuteForBlobFileDescriptor(SQLiteConnection.java)
	at android.database.sqlite.SQLiteConnection.executeForBlobFileDescriptor(SQLiteConnection.java:866)
	at android.database.sqlite.SQLiteSession.executeForBlobFileDescriptor(SQLiteSession.java:722)
	at android.database.sqlite.SQLiteStatement.simpleQueryForBlobFileDescriptor(SQLiteStatement.java:152)
	at de.blau.android.services.util.MapTileProviderDataBase.getTile(MapTileProviderDataBase.java:245)
	at de.blau.android.services.util.MapTileFilesystemProvider$TileLoader.run(MapTileFilesystemProvider.java:253)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at java.lang.Thread.run(Thread.java:1012)

You should be able to recover by deleting the tile cache and using airplane mode.
I hadn't thought of this, I restarted Vespucci from scratch before reading your advice, tried to set the same wms url again and got the same reported result, then I followed your instructions (clear cache and turn on airplane mode) and it didn't work, Vespucci crashes, but now Android throws the message = Close App or Wait.

I want to indicate that the wms had already been configured previously in other versions and it worked correctly, then I had a problem (I don't remember which one) and I had to reset Vespucci from scratch, I had not linked the wms again until yesterday when I downloaded the new version and I wanted to see a small path that was not visible with the usual satellite images

In any case could you give me the URL you entered for the WMS server? It is definitely returning something weird.

https://sigmzl.manizales.gov.co/wadmzl/services/Ortofotomapas/2022_ORTOFOTO_RURAL/MapServer/WMSServer?

P.S. Thanks for answering.

Vespucci crashes, but now Android throws the message = Close App or Wait.

What happens if you just wait? Note that rebooting your phone may help after an OOM situation.

Further question do you know if the WMS server is supposed to be reachable outside of Colombia? I don't seem to be able to connect to it.

Further point which would explain the ANR (App Not Responding error): looking through the log of the initial crash it seems as if you had around a dozen imagery layers configured. Each layer is allocated an in memory cache that can be quite large. The maximum size each individual cache can grow to for raster tiles is 1/8th of the available memory.

So it is better to only have a small number of raster layers, like 3-4, and if you need different content to change the tile source, this will reuse the cache.

Running out of memory will cause the JVM garbage collector to run a lot and eventually slowing down the app to a point that you will get ANRs from the operating system.

Further question do you know if the WMS server is supposed to be reachable outside of Colombia? I don't seem to be able to connect to it.

The wms covers the total area of ​​my city (urban and rural), Manizales, Caldas.
I do not know if it is possible to access from outside the country. Have you tried to display the city area first?
coordinates

The WMS server seems to consistently time out from here, in any case

I'm fairly sure the OOM is in the end due to the many layers you had configured.
This can't really be the case with Android 8 and later, so it is back to an issue with the WMS server. Could you copy the information from the Debug screen to this issue, just so that I can check if something is weird.

19.3 will have an improved "Safe" mode that will allow you to disable all layers prior to starting up making such situations substantially easier to recover from.

Further point which would explain the ANR (App Not Responding error): looking through the log of the initial crash it seems as if you had around a dozen imagery layers configured. Each layer is allocated an in memory cache that can be quite large. The maximum size each individual cache can grow to for raster tiles is 1/8th of the available memory.

So it is better to only have a small number of raster layers, like 3-4, and if you need different content to change the tile source, this will reuse the cache.

Running out of memory will cause the JVM garbage collector to run a lot and eventually slowing down the app to a point that you will get ANRs from the operating system.

Indeed I had several raster layers configured=
OSM GPS traces
WMS IGAC 1/100K river layer.
Municipal and departmental borders layer designed by me through MapBox Studio and served as tms.
MapBox Outdoors (modified with MapBox Studio).
ESRI World Imagery
Bing Aerial
OpenStreetMap Standard
From now on I will have fewer raster layers configured.
However, I must indicate that they are the maps and layers that I had linked for 2 Vespucci versions and had not presented problems.
I must also indicate again that the wms that caused the error had already been linked to Vespucci in other versions and had not presented problems.
After resetting Vespucci, I only linked the orthoimage wms and Vespucci crashes again, which indicates that the problem is only related to this wms and not to the other layers linked. I will do the test with another wms URL.

Could you copy the information from the Debug screen to this issue, just so that I can check if something is weird.

What should I do?

P.S. I just linked the wms IGAC 1/100K, Vespucci works perfectly and the selected layer shows correctly.
Screenshot_20230826-095136

Indeed I had several raster layers configured=

This cannot be the issue on your device. Before Android 8 bitmaps were stored in the JVM heap of the app, and as every image layer allocates up to ~50MB of cache that could have caused problems, but since Android 8 bitmap storage allocates memory directly from the system that can be ruled out as causing the issue.

After resetting Vespucci, I only linked the orthoimage wms and Vespucci crashes again, which indicates that the problem is only related to this wms and not to the other layers linked. I will do the test with another wms URL.

Unluckily the server continues to time out on me, so not very much I can do further right now. But as said the output from the Debug page (main overflow menu, right at the bottom) would be good to have in any case.

Lets try a slightly different approach to this. Could you open

https://sigmzl.manizales.gov.co/wadmzl/services/Ortofotomapas/2022_ORTOFOTO_RURAL/MapServer/WMSServer?request=GetCapabilities&service=wms

in a browser, and attach the output to this issue, it should be an XML document.

Edit: I got a colleague outside of Switzerland (France in this case) to try and it worked for them, so I have that. But still need this:

Then when you added the server it should have created a custom background imagery entry, could you copy the URL from that entry here? You don't need to activate or save the entry so there shouldn't be any danger of a crash.

099cf51311b3834130b0ad15e07898e1-7500bf435679fc5df0b0efe60059066dc31acbdd.zip

Thanks, that looks good. So it is requesting png8 format tiles which shouldn't really be a problem. If you are brave you could try changing image/png8 to image/jpeg but that is just a wild guess on my behalf and it could just as well crash.

Gracias, eso se ve bien. Por lo tanto, solicita mosaicos en formato png8, lo que realmente no debería ser un problema. Si eres valiente, puedes intentar cambiar image/png8 a image/jpeg , pero eso es solo una suposición descabellada por mi parte y también podría fallar.

Sorry for the delay in replying, I work in rural areas where I mostly don't have internet access.
I had thought about doing it by looking at the capabilities(PNG), I also had doubts about 1.3.0 and change it to 1.1.1 because that's how I have it linked in OruxMaps and in a json style.

Closing as stale.