As the old R&B song suggests, "it’s cheaper to keep her," but at some point you’ll want to stop throwing good money after bad.

With the average cost of a new car now at around $33,600, and the median U.S. household income standing at about $57,600, it’s no wonder that U.S. motorists are holding onto their rides for longer than ever to stretch their vehicular budgets.

According to the research firm IHS Markit, the average age of all cars and light-duty trucks on the road is up to a record 11.6 years, with the average length of new and used-vehicle ownership likewise reaching historic levels at 6.6 and 5.5 years, respectively.

But at what point does it become more economical to buy a new car instead of continuing to pour money into an old heap?

Read More: Should You Buy A New Car Or A Used One?

The "50 Percent" Rule

On a purely pragmatic basis, it’s almost always cheaper to keep an existing car running than to purchase a new one. Even having to cover the cost of a catastrophic repair – replacing a blown engine or automatic transmission, for example, can set an owner back $3,000 or more – might be worth the investment if the vehicle is otherwise in good shape. You’d still have to come up with at least as much cash up front for a down payment to acquire a new vehicle, and take on added ongoing costs to finance or lease and insure it.

Auto experts suggest consumers follow the so-called 50 percent rule when facing a particularly costly vehicular renovation. By this yardstick, when the cost of a needed repair approaches 50 percent of a model’s estimated resale value it’s probably time to go car shopping.

Datsun 240Z

Consumers should also take into consideration a vehicle’s current condition and its history of reliability when deciding whether to keep it running or replace it. If a car looks good and has been maintained meticulously, having a mechanical problem fixed now might prolong its life for tens of thousands of miles down the road. Given proper maintenance and needed repairs, today’s cars can exceed 200,000 miles.

On the other hand, if a vehicle has been ill cared-for and/or has been suffering from chronic mechanical problems an owner may be throwing good money after bad to keep it limping along until the next repair. Also, replacing a steady stream of key wear-and-tear items and systems (tires, battery, starter, alternator, exhaust system, etc.) is inevitable on a high-mileage older model, even one that’s otherwise in decent shape. Cars approaching the 100,000-mile mark often require replacing the engine’s timing belt, which can be an unusually costly operation and involve swapping out related items including the water pump. What’s more, one has to consider both the cost and inconvenience of frequent trips to the repair shop, versus the peace of mind driving (an assumedly) trouble-free new model that comes with a full warranty.

Read More: Should You Buy Or Lease Your Next Car?

That New-Car Smell (And More)

Then there’s both functional and purely cosmetic issues to consider. For example, those who even occasionally transport clients or business associates might be sensitive about driving a car with well-worn upholstery or one that suffers from assorted cosmetic issues. Someone whose job involves a long-distance commute may not want to take a chance on an older model breaking down away from home. Those with growing families might want to trade up to a larger car or SUV, while empty nesters might consider downsizing their rides.

What’s more, buying or leasing a new model means having access to features one’s current model may lack, especially important safety-related items like accident-avoidance systems, a backup camera, and wireless Bluetooth phone pairing. And there’s no denying the emotional allure of driving a shiny new (or reasonably used) car, especially if you’ve grown sick and tired of the old one.

Read More: How To Get The Most Money Selling A Used Car

Doing The Deals

Finally, those deciding whether to repair or replace a car should consider the fact that it’s a great time to go shopping for a vehicle, whether it’s a brand-new model or a used one. Interest rates remain reasonably low, and with new-vehicle sales having sputtered in recent months, automakers are luring shoppers into showrooms with some big-money incentives, including cash-back rebates, cut-rate financing programs, and discounted lease deals. Automakers were reportedly spending an average of around $3,500 per vehicle in incentives at mid-year 2017, with no end in sight seen to the marketing largess.

Meanwhile, on the pre-owned side of the lot, a glut of two- and three-year-old off-lease cars returning to the market is creating a buyer’s market among late-model used vehicles. An estimated 12 million used vehicles with low miles and in great shape are expected to reach dealers’ lots by the end of 2019 following the recent leasing spurt, according to the auto auction company Manheim and Reuters. That’s causing inventories to swell and, importantly, prices to soften, with the latter being especially pronounced among small, midsize, and large sedans that are losing market share to more popular crossover SUVs and pickup trucks these days.

Nissan 370Z

For example, according to JD Power Valuation Services, while the average wholesale price of a recent-vintage used car dropped by 2  percent during July, 2017, the cost of a pre-owned compact car fell by 3.4 percent.

One exception, however, is with older, so-called “beater” cars, of which there currently happens to be a shortage due to slumping new-vehicle sales during the recession and 2009’s “Cash for Clunkers” program that took 677,000 models out of the market. While this is bad news for cash-strapped used-car shoppers, it signals an opportunity for those holding onto older vehicles to cash in and trade up to a new, or at least newer, model. Dealers are reportedly on the lookout for well-worn, but well-kept older models and are willing to pay top dollar for them in trade or an outright purchase.

Read More: How Much Is My Car Worth?