Money managers have been cutting back their bets on oil in the run up to the crucial meeting of the Organization of the Petroleum Exporting Countries in Vienna this week.

The number of bets taken by hedge funds and other big investors on the global oil benchmark Brent—comprising bets on both rising and falling prices—has fallen to just over 320,000, the equivalent of 320 million barrels of oil, its lowest level in nine months. The number of bets on West Texas Intermediate, the U.S. gauge, is at its lowest since the beginning of January.

The $2.5 billion United States Oil Fund LP, the largest U.S. exchange-traded fund investing in U.S. oil futures, has also drawn back, registering outflows of close to $1 billion in the past two months, according to investment research company Morningstar. In April, the fund lost $550 million, the biggest withdrawal since 2011. It lost another $390 million in May, the data shows.

Analysts say the reticence among funds to take positions ahead of the OPEC meeting is a sign speculators are losing patience with gyrating oil prices which have made many trades go wrong in recent months. Oil has fluctuated between $45 and almost $70 a barrel this year.

Fund industry insiders highlight a run of bad performance for funds that have tried to second-guess moves in commodity markets.

"There's very little positioning around that [OPEC] meeting," said Jennifer Mernagh, investment manager at Aberdeen Asset Management, which has $491 billion in assets under management. "Managers haven't had much position on [oil] at all this year. Most would get out of the way of the meeting rather than position for it."

Some macro hedge funds, which can bet on a range of assets including energy, have avoided oil because they have found better opportunities elsewhere, for instance in currencies.

And hedge funds specializing in commodities trading, which once commanded many more billions of dollars, are now dwindling in number.

According to Hedge Fund Research, there were 72 discretionary commodity hedge funds at the end of last year, down from 90 a year before. That has come on the back of negative returns in three of the previous four calendar years, as well as in February, March and April this year.

Among funds wound down in recent years are BlueGold Capital Management LLP, Clive Capital, Centaurus Capital, Abydos Capital Management and Brevan Howard Asset Management's commodities fund.

"The pool is smaller than it was," said one London-based hedge fund executive, adding that the OPEC meeting was "probably less of a big thing than it was."

Returns from the survivors have been unspectacular. Swiss-based Krom River's Commodity fund is down 2.1% this year, having lost money in each of the three previous calendar years, according to data reviewed by The Wall Street Journal. The firm declined to comment. Armajaro Asset Management's Commodities fund is down 5% this year, following a 13.8% loss last year, the data showed.

One exception has been the Andurand Commodities fund, run by Pierre Andurand, former chief investment officer at hedge fund BlueGold Capital Management LLP. Andurand Commodities is up 15% in the first three months of this year, having gained around 38% last year.

Oil prices rebounded in recent months on expectations that the global oil glut that drove prices off a cliff last year will soon start to abate. But the rally stuttered last month and many investors have taken flight from oil.

"Oil's momentum clearly slowed down in May," said Miswin Mahesh, oil market analyst at Barclays. "Many trades went wrong and had to be unwound."

Gareth Lewis-Davies, oil analyst at BNP Paribas, says the consensus that OPEC won't cut its output target, preventing a speedier recovery in Brent prices, has depressed sentiment on the market. "This is now being reflected in the money managers' positioning," he said.

Write to Laurence Fletcher at laurence.fletcher@wsj.com and Georgi Kantchev at georgi.kantchev@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires