Mattresses used in RVs and boats are usually pretty similar. However, many boats have a v-berth in the bow as a sleeping area and those require specially shaped mattresses to fit into the pointy end of the boat. Some folks like to use some kind of anti-moisture tiles under the mattress so that any water that accidentally gets into the boat doesn't get soaked up by the mattress. The cab over beds on truck campers also frequently benefit from anti-moisture tiles. Of course, if the amount of water exceeds the depth of the tile (usually about 1/2" - 3/4") the mattress will still get wet. Most of what is given below for RV mattresses also applies to boat mattresses.
RV Mattresses. RVs are intended to provide us most of the creature comforts we enjoy at home, including a comfortable bed. I'm sure we all agree that getting a good night's rest is essential for safe, enjoyable, successful travel and outdoor activities. Most RV beds are pretty comfortable, or at least start out that way. But not all RV mattresses are created equal nor hold up as well. Cheap mattresses will break down faster than better quality products and no one sleeps well on a thin or broken down, lumpy mattress. Mattresses in used RVs can be a mystery. Some may be OEM, some replacements. Replacements may be upgrades or even downgrades so you don't know what you're getting. In addition to original quality, use and care will also affect performance and longevity. If the previous owner was very large or for some reason carried heavy cargo on the bed, the mattress may not last long. Are RV mattresses really that different from the residential mattresses you use at home? Sometimes they are. For one thing, you can save weight using a thinner or lighter mattress so many RVs come with sleep systems that are often considered inferior to the one on your bed at home to reduce weight and cost. If you're used to an extra thick and comfy mattress at home, you might find the thin pad in some RVs disappointing. For another thing, they are sometimes different sizes than the standard sizes used at home. For example, what you might take for an ordinary double bed in some motorhomes is actually a 3/4 size mattress at 48" wide, compared to 54" for a standard double mattress. If you don't think 6" makes much difference, try sleeping two people on a 3/4 size mattress! RV King and Queen mattresses are usually not the same size as their residential namesakes. Some RVs use a corner bed to save space and they'll often have the exposed corner cut off to provide more aisle space. The cut corner usually doesn't affect sleeping unless someone quite tall sleeps on that side of the bed and their feet hang over, but if you replace it with a mattress that doesn't have the cut corner it can both droop and can get in the way of getting past the bed, which is usually the path to the corner bathroom in the other rear corner of the RV. Sometimes you can add support under the extended corner, but it might mean banging your shins when you go by. RV Queen and RV King mattresses are usually a little shorter than standard residential models. If there is room and you can sacrifice a few inches of walking space you can usually upgrade to residential size mattresses, but you might need to extend the platform so the mattress doesn't sag where it hangs over the edge. If the existing mattress already goes from wall to wall, there won't be room for a larger one.
There are many reasons why you might want to replace an RV or boat mattress. As mattresses age, the cover fabric may deteriorate and tear, padding may get compressed or shift, springs may collapse or break, or the mattress may become stained or soiled so that it is unpleasant and perhaps unhealthy to sleep on. Boat mattresses, often subjected to excess humidity, can develop mold and mildew that makes them unhealthy as well as unpleasant.
You can buy replacement mattresses from RV stores like Camping World or you can have them custom made. Any good upholstery shop should be able to order and cut foam to fit your RV and make a suitable cover if you don't have a local mattress maker. Having a custom made foam mattress may be less expensive than you might think, especially if you can use an off-the-shelf mattress cover instead of having one custom made. If the cover is slightly smaller it still might work but it could make the mattress bow in the middle. If it is too big you can usually fold it over and tuck it under to make it work -- or, if you're handy in the sewing department, you can alter it to make it fit to your satisfaction.
You can even buy famous brand name mattresses, including Serta and Sleep Number beds, to fit most RVs. Be sure to measure your mattress to be sure you're getting one that will fit right. The "Queen" and "King" beds in some RVs are NOT the same size as standard Queen and King beds at home, although sometimes standard mattress can be made to work. When measuring for a new mattress, measure the platform, not the old mattress. The shape and dimensions of the old mattress may have been distorted by use and by temperature and humidity or the old mattress might already have been a replacement that may or may not have been sized right.
If your old mattress is breaking down and is no longer comfortable to sleep on, you can either replace it with a new mattress or consider adding a mattress topper. A mattress topper will usually be a lot less expensive and often gives very satisfactory results. A mattress topper is not the same thing as a mattress pad. Toppers are usually much thicker and made of foam. Pads are mostly made of cotton. You can buy memory foam mattress toppers and it is pretty easy to cut the foam down if it is larger than your mattress. An electric knife is very good for cutting foam. You may have to alter the cover for the mattress topper to fit the reduced size -- or just tuck it under. We added a 4" memory foam topper to the rather skimpy RV mattress in one of our motorhomes and it made for a very comfortable bed. With a good topper over an older mattress that is breaking down you probably won't notice the diminished performance of the original mattress. Your sleeping comfort will be mostly determined by the topper, with the original mattress simply providing a cushioned foundation. Given that a topper sells for around $100 and new mattress can cost more than $400, a mattress topper is a very attractive option. A 4" topper changes a skimpy 4"mattress into a comfortable 8" thick sleep system. We have even used memory foam toppers in the v-berth in our sailboats.
Some people find foam mattresses too hot to sleep on since they are not good conductors of heat and often don't allow the kind of air circulation that is possible in an innerspring mattress. If you're one of those people, use a cotton mattress pad over your foam mattress or topper. Feather beds are an attractive alternative for some people (unless you're allergic to feathers!).
A simple mattress pad may solve issues with sensitivity to foam. Pads made of cotton usually provide the most neutral solution, insulating you from the temperature attributes of the foam. Some people like the luxurious softness of a "feather bed". If you find yourself already out on a trip when you discover your mattress seems to hot or too cold, you can probably make do with an extra blanket between the bottom sheet and the mattress. Even an itchy wool blanket would be OK since it would be under the sheet -- unless you are particularly sensitive or allergic to wool, in which case I would wonder why you'd have a wool blanket in the first place.
Air mattresses can be a lightweight alternative to replacing a mattress if you can find one to fit. In addition to being very light weight you can adjust the firmness to fit your personal needs. But, some people find the plastic surface hot or cold to sleep on. This can usually be overcome with a mattress pad and still enjoy the benefits of an air mattress -- low cost, light weight, infinitely adjustable firmness. If you opt for an air mattress, be sure to carry a repair kit so you can fix any leaks that might crop up in camp. It really isn't fun waking up on flattened mattress! Quality air mattresses are generally pretty sturdy if they aren't punctured or otherwise abused. Since you can't change the shape of an air mattress they won't fit in v-berths on boats.
Sleep well.