Mayor Marion Barry's administration may soon order a study of the feasibility of building a prison in the District of Columbia and already has prepared a list of possible sites, according to City Administrator Thomas Downs.

Most of the potential sites, including Bolling Air Force Base and other property along the Anacostia River, are owned or controlled by the federal government, Downs said.

Until recently, Barry strongly opposed any proposal for major expansion of the D.C. Jail, near the Robert F. Kennedy Memorial Stadium, or the city-operated Lorton Reformatory in southern Fairfax County, which together were built to house a maximum of about 4,880 prisoners.

Last month, the facilities exceeded their capacity by about 1,250 prisoners.

But the mayor softened his stand during hearings on Capitol Hill last Wednesday in the face of mounting pressure from Sen. Arlen Specter (R-Pa.), chairman of the District Appropriations subcommittee, as well as support from U.S. Attorney Joseph E. diGenova and Specter to finance a new facility with federal funds.

"He Barry never had an offer of the kind that the senator and the U.S. attorney made, clearly recognizing its federal responsibility," Downs said. "I don't think anyone before raised the possibility of 100 percent federal funding, rather than the city borrowing the money."

City Council Chairman David A. Clarke came out yesterday in support of expanding the District's facilities for convicted felons, although he said it would make more sense to further expand Lorton rather than build a separate prison facility in the city.

Downs said the mayor may include funds in his fiscal 1986 budget proposal, which will be sent to the City Council Feb. 1, to undertake a feasibility study for a new facility for convicted felons serving extended terms.

"That's a possibility, yes," he said.

DiGenova said yesterday that he now is optimistic that a new prison will be built as a result of the mayor's change of heart.

"We are all very hopeful that the realism displayed at the hearings by everyone will result in more jail space," he said. "I'm very sanguine about those prospects."

DiGenova said the federal government should bear the cost of building new facilities since it is still responsible, through the U.S. attorney's office, for prosecuting almost all D.C. criminal cases.

According to District officials, a new facility would cost from $40,000 to $80,000 per cell.

Meanwhile, Sens. John W. Warner and Paul S. Trible, both Virginia Republicans, have asked the National Institute of Corrections to outline steps for building new prison facilities in the District to house the city's entire inmate population, so that Lorton could be closed.

The institute received a federal grant to study the city's prison problems. Warner and Trible asked in a letter to institute director Raymond Brown this week that the study also consider ways of capping the inmate population at Lorton. They asked that a report be completed within three months.

"We believe the report should provide the basis for quick agreement between District officials and the Congress on the type of new prison space to be established," the letter stated.

One House staff aide pointed out that the District's juvenile detention facility at Cedar Knoll in Laurel is to be closed soon and "that seems like a logical site for something" such as a minimum security facility.

A prison in that area might run into less public opposition because the Maryland prison at Jessup is only about a mile away and people there are used to the institution, the aide said.

Prospects for federal funding for new construction appear to be good, according to some key congressional players.

"I think the House and Senate would be willing to measure up to the responsibility to fund necessary construction," said Specter, who in past years had succeeded in getting millions of dollars added to the District's annual appropriation bill for special criminal justice projects.

If the mayor recommended building a new prison facility and requested federal funding, "I would be surprised if the House District committee wouldn't go along with that," said Edward C. Sylvester Jr., the committee's majority staff director.

Rep. Thomas Bliley (R-Va.), a member of the District Committee, said,however that he believes the cost should be shared between the federal government and the city.

"With the size of the federal deficit, to get the federal government to fund it totally is going to be difficult," Bliley said. "Realistically, it's going to have to be a shared cost."

Specter's subcommittee had disputed estimates by city officials that its jail population was due to decline, and diGenova presented figures last week showing a trend toward a skyrocketing number of arrests, indictments and convictions.

The D.C. Department of Corrections is working on a profile of the D.C. prison population to determine if there are any persons in jail now who do not belong there.

The mayor had suggested at a November press conference and again at last week's hearing that there might be persons in prison for lesser charges who could be released and made to provide community services or make restitution rather than serving time.

But diGenova predicted that the profile would show no "softness" in the prison population and would substantiate the need for expanded prison capacity.

City Council member Wilhelmina J. Rolark, chairman of the Judiciary Committee, questioned the need for a new jail or prison yesteday. She said the city could take numerous steps to deal with the problem of overcrowding short of new construction. While society must be protected from criminals, she said, "Whether the solution is more jails, I don't know."

Rolark said she favors more programs for diverting and rehabilitating offenders. This week, she introduced a "Youth Rehabilitation Act" that would give the courts broad discretion in sentencing offenders ages 18 to 22 and placing them in rehabilitation programs. Similar federal legislation was repealed last October.